From 12234c7b459cfe2542e1160d26e179c19bd606c4 Mon Sep 17 00:00:00 2001 From: idevlab Date: Wed, 16 Sep 2026 15:53:32 +0800 Subject: [PATCH 1/2] refactor(desktop): unify settings page rhythm and layout - converge every settings tab on one 48rem measure - route appearance and memory headings through shared section primitives - align SettingsSection title weight to 600 and render Usage via PageHeader - make `sm` button an alias of the 28px `compact` size - add settingsRhythmContract test and SDLC records --- .../components/business/settings-section.tsx | 2 +- apps/desktop/src/components/ui/button.tsx | 2 +- .../src/settings/AppearanceSettings.tsx | 107 ++++++---------- apps/desktop/src/settings/MemorySettings.tsx | 13 +- apps/desktop/src/settings/SettingsPage.tsx | 9 +- .../src/settings/SettingsPrimitives.tsx | 15 ++- .../src/settings/appearance-settings.css | 51 +------- apps/desktop/src/settings/memory-settings.css | 16 +-- apps/desktop/src/settings/settings-page.css | 23 +--- apps/desktop/src/usage/Usage.tsx | 15 +-- .../desktop/tests/appearanceSettings.test.tsx | 6 +- .../tests/settingsLayoutContract.test.ts | 7 +- .../tests/settingsRhythmContract.test.ts | 118 ++++++++++++++++++ .../intent.md | 50 ++++++++ .../plan.md | 60 +++++++++ .../spec.md | 58 +++++++++ .../verification.md | 59 +++++++++ 17 files changed, 433 insertions(+), 178 deletions(-) create mode 100644 apps/desktop/tests/settingsRhythmContract.test.ts create mode 100644 docs/sdlc/changes/2026-09-16-unify-settings-page-rhythm/intent.md create mode 100644 docs/sdlc/changes/2026-09-16-unify-settings-page-rhythm/plan.md create mode 100644 docs/sdlc/changes/2026-09-16-unify-settings-page-rhythm/spec.md create mode 100644 docs/sdlc/changes/2026-09-16-unify-settings-page-rhythm/verification.md diff --git a/apps/desktop/src/components/business/settings-section.tsx b/apps/desktop/src/components/business/settings-section.tsx index d0a4bbfd..379ea923 100644 --- a/apps/desktop/src/components/business/settings-section.tsx +++ b/apps/desktop/src/components/business/settings-section.tsx @@ -33,7 +33,7 @@ function SettingsSection({

{title}

diff --git a/apps/desktop/src/components/ui/button.tsx b/apps/desktop/src/components/ui/button.tsx index 5b31ab5b..c036e170 100644 --- a/apps/desktop/src/components/ui/button.tsx +++ b/apps/desktop/src/components/ui/button.tsx @@ -31,7 +31,7 @@ const buttonVariants = cva( field: "h-control-field gap-inline px-surface-inset has-[>svg]:px-module-inset", xs: "h-control-mini rounded-control text-metadata gap-1 px-2 has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3", - sm: "h-control-mini rounded-control has-[>svg]:px-module-inset gap-1.5 px-3", + sm: "h-control-mini gap-inline px-surface-inset has-[>svg]:px-module-inset", lg: "h-control-field rounded-control px-6 has-[>svg]:px-4", icon: "size-control", "icon-xs": diff --git a/apps/desktop/src/settings/AppearanceSettings.tsx b/apps/desktop/src/settings/AppearanceSettings.tsx index 2e20504d..21f052b8 100644 --- a/apps/desktop/src/settings/AppearanceSettings.tsx +++ b/apps/desktop/src/settings/AppearanceSettings.tsx @@ -2,6 +2,7 @@ import { useEffect, useRef, useState } from "react"; import { SettingRow } from "@/components/business/setting-row"; import { SettingToggle } from "@/components/business/setting-toggle"; +import { SettingsSection } from "@/components/business/settings-section"; import { ViewSwitcher } from "@/components/business/view-switcher"; import { Button } from "@/components/ui/button"; import { Copy, Download, Plus, Trash2, Upload } from "@/components/ui/icons"; @@ -664,16 +665,10 @@ export function AppearanceSettings({ return (
-
-

- {t("settings.colorScheme")} -

))}
-
+ -
-

- {t("settings.typography")} -

{PROFILE_SCHEMES.map((scheme) => ( setAppearanceSettings({ codeFontSize })} />
-
+ -
-
-

- {t("settings.themes")} -

-
+
-
+ + } + >
{catalog.map((theme) => ( ))}
-
- -
-
-
-

- {t("settings.themeEditor")} -

-

- {activeTheme.builtin - ? t("settings.builtinThemeHint") - : t("settings.customThemeHint")} -

-
-
+ + +
-
+ + } + >
{!activeTheme.builtin && (
- + -
-

- {t("settings.surfaces")} -

{PROFILE_SCHEMES.map((scheme) => ( ))}
-
+ -
-

- {t("settings.appearancePreferences")} -

-
+ {status && (

diff --git a/apps/desktop/src/settings/MemorySettings.tsx b/apps/desktop/src/settings/MemorySettings.tsx index 44471676..c5817c45 100644 --- a/apps/desktop/src/settings/MemorySettings.tsx +++ b/apps/desktop/src/settings/MemorySettings.tsx @@ -85,6 +85,7 @@ import { originLabelKey, } from "./memory-model"; import type { MemoryFilter, MemoryView } from "./memory-model"; +import { GroupHeading } from "./SettingsPrimitives"; import "./memory-settings.css"; @@ -616,7 +617,7 @@ function DetailPanel({

-

{t("memory.evidence")}

+ {t("memory.evidence")}