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 ( ); }