From 2b15bc671087a2d9215463109dff8b573ba1efd7 Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Sun, 28 Jun 2026 22:25:39 +0800 Subject: [PATCH] =?UTF-8?q?feat(webui):=20group=20Settings=20sidebar=20int?= =?UTF-8?q?o=20=E6=8E=A7=E5=88=B6=E5=8F=B0=20/=20SnowLuma=20/=20=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The flat tab strip mixed three domains — the dashboard itself, the all-accounts SnowLuma protocol runtime, and the host/platform. Regroup into 3 labelled sections (macOS System-Settings idiom): section headers show on the desktop rail; the mobile strip stays a flat wrap via display:contents. Each group is a role=group + aria-labelledby; the nav gains an aria-label. This gives '全局配置' (and future global protocol knobs) a principled home and ends the mixing. Phase 4 (final) of the global-settings split. --- .../src/components/pages/settings-page.tsx | 96 +++++++++++++------ 1 file changed, 69 insertions(+), 27 deletions(-) diff --git a/packages/webui/src/components/pages/settings-page.tsx b/packages/webui/src/components/pages/settings-page.tsx index fd5da6d9..50013b0f 100644 --- a/packages/webui/src/components/pages/settings-page.tsx +++ b/packages/webui/src/components/pages/settings-page.tsx @@ -45,17 +45,40 @@ import { NotificationsPanel } from '@/components/settings/notifications-panel'; import { GlobalConfigPanel } from '@/components/settings/global-config-panel'; import { SystemPanel } from '@/components/settings/system-panel'; -const TABS: { key: SettingsTab; label: string; icon: typeof Sun }[] = [ - { key: 'appearance', label: '外观', icon: Palette }, - { key: 'data', label: '数据与格式', icon: RefreshCw }, - { key: 'advanced', label: '高级', icon: Code2 }, - { key: 'account', label: '账号安全', icon: ShieldCheck }, - { key: 'system', label: '服务', icon: Server }, - { key: 'notifications', label: '通知', icon: Bell }, - { key: 'globalConfig', label: '全局配置', icon: SlidersHorizontal }, - { key: 'about', label: '关于', icon: Info }, +interface TabDef { key: SettingsTab; label: string; icon: typeof Sun } + +// Three domains, rendered as macOS System-Settings-style sidebar sections: +// the dashboard itself (控制台), the all-accounts SnowLuma protocol runtime, +// and the host/deployment (平台). Section headers show on the desktop rail +// only; the mobile strip stays a flat wrap. +const TAB_GROUPS: { title: string; tabs: TabDef[] }[] = [ + { + title: '控制台', + tabs: [ + { key: 'appearance', label: '外观', icon: Palette }, + { key: 'data', label: '数据与格式', icon: RefreshCw }, + { key: 'account', label: '账号安全', icon: ShieldCheck }, + ], + }, + { + title: 'SnowLuma', + tabs: [ + { key: 'globalConfig', label: '全局配置', icon: SlidersHorizontal }, + { key: 'notifications', label: '通知', icon: Bell }, + ], + }, + { + title: '平台', + tabs: [ + { key: 'system', label: '服务', icon: Server }, + { key: 'advanced', label: '高级', icon: Code2 }, + { key: 'about', label: '关于', icon: Info }, + ], + }, ]; +const TABS: TabDef[] = TAB_GROUPS.flatMap((g) => g.tabs); + export function SettingsPage() { // Active tab lives in the URL (`?tab=`) so it's deep-linkable — e.g. the // sidebar update banner jumps straight to 关于. Default tab omits the param. @@ -98,32 +121,51 @@ export function SettingsPage() { function SettingsNav({ tab, onChange }: { tab: SettingsTab; onChange: (t: SettingsTab) => void }) { return ( ); }