fix(widgets): drop the group widget's repeated title

The dashboard card already carries the title, so the row label repeated it. The panel now names the widget the way it names every other one, by its title when titles are shown.
This commit is contained in:
Zakk committed 2026-10-04 14:36:38 +11:00
1 parent 33abd5385b
commit d7deaff393
3 files changed
+12 -14

No files matched your search

+10 -12
View File
@@ -50,18 +50,16 @@ export function GroupWidget({item, onChange}: {item: Widget; onChange?: (item: W
<Reading state={groups}>
{selected ? (
<>
<WidgetRow label={t('widgets.group')}>
<ChoiceMenu
quiet
label={t('ui.group')}
value={selected.id}
items={(groups.data ?? []).map(group => ({id: group.id, label: group.name}))}
onChange={group => onChange?.({...item, group})}
searchLabel={t('ui.filterGroups')}
>
{selected.name}
</ChoiceMenu>
</WidgetRow>
<ChoiceMenu
quiet
label={t('ui.group')}
value={selected.id}
items={(groups.data ?? []).map(group => ({id: group.id, label: group.name}))}
onChange={group => onChange?.({...item, group})}
searchLabel={t('ui.filterGroups')}
>
{selected.name}
</ChoiceMenu>
<GroupControl id={selected.id} refresh={groups.refetch} />
</>
) : (
+1 -1
View File
@@ -178,7 +178,7 @@ it.each([
],
['lists', idsWith(definition => definition.rows), ['nodeLatency', 'ranking', 'notices', 'policyGroups', 'sourceHealth', 'outbounds', 'connectionOutbounds']],
['rates', idsWith(definition => definition.rate), ['speed', 'history', 'download', 'upload']],
['untitled in the panel', idsWith(definition => definition.untitled), ['connections', 'cpu', 'global', 'group']],
['untitled in the panel', idsWith(definition => definition.untitled), ['connections', 'cpu', 'global']],
['group choices', idsWith(definition => definition.groupChoice), ['nodeLatency', 'policyGroups', 'latency']]
])('derives the %s from the registry', (_name, derived, expected) => expect(derived).toEqual([...expected].sort()));
it('names the Automatic group as each widget did', () => {
+1 -1
View File
@@ -71,7 +71,7 @@ const definitions = {
outbounds: share('widgets.outbounds', 'runtime_outbounds'),
mode: {...list('act.mode', 'config'), sizes: ['medium']},
global: {...list('act.global', 'config'), sizes: ['medium'], untitled: true},
group: {...list('widgets.group', 'groups'), sizes: ['medium'], widest: '2/3', untitled: true},
group: {...list('widgets.group', 'groups'), sizes: ['medium'], widest: '2/3'},
status: {...list('widgets.status', 'runtime'), sizes: ['medium'], forms: ['facts', 'kv'], compact: ['kv']},
notices: {...list('widgets.notices', 'events'), rows: true},
download: {...metric('ui.download', 'runtime'), tile: true, rate: true},