From a75e804e75ee02bcae4e08f96316a5f9610e0b90 Mon Sep 17 00:00:00 2001 From: "Bingxi Zhao (Frank)" <13051345080@163.com> Date: Tue, 24 Nov 2026 15:21:31 +0800 Subject: [PATCH] feat(settings): render preferences as a floating card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Settings used to replace the whole window: a fixed full-height shell with a 248px rail and sections drawn as bare hairlines. It now opens as a Claude-style preferences card — a scrimmed, rounded panel capped at 1080x820 (88dvh) with a 224px rail, and each section sits in its own bordered card so the page stays light without going full screen. Phones keep the full sheet because a floating card has no room there. The settings heading drops from the 30/32px feature-page title to a 20px card-scale heading via a local header instead of PageHeader, and the shared save/discard toolbar stays pinned inside the card. --- web/components/settings/SettingsMain.tsx | 76 +++++++++++++++--------- web/components/settings/shared.tsx | 56 +++++++++++------ 2 files changed, 86 insertions(+), 46 deletions(-) diff --git a/web/components/settings/SettingsMain.tsx b/web/components/settings/SettingsMain.tsx index 3bda5d943..3d3a3e6c0 100644 --- a/web/components/settings/SettingsMain.tsx +++ b/web/components/settings/SettingsMain.tsx @@ -57,39 +57,57 @@ export default function SettingsMain({ children }: { children: React.ReactNode } ) return ( + // Settings is a floating preferences card, the way Claude's desktop + // settings behaves: the app stays visible behind a scrim and the card keeps + // its own rounded edge, so opening settings no longer replaces the whole + // window. Phones have no room for a floating card and get the full sheet.
- -
-
- {returnButton} - +
+
- - -
-
- - - {children} - -
- -
+ + + {children} + +
+ + + setMobileOpen(false)} diff --git a/web/components/settings/shared.tsx b/web/components/settings/shared.tsx index c69f68853..6123ee39b 100644 --- a/web/components/settings/shared.tsx +++ b/web/components/settings/shared.tsx @@ -1,6 +1,5 @@ "use client"; -import { PageHeader } from '@/components/layout/FeaturePage' import type { CatalogProfile, ServiceName, @@ -149,7 +148,7 @@ export function SettingRow({ control: React.ReactNode; }) { return ( -
+
{title} @@ -166,6 +165,9 @@ export function SettingRow({ } // Page-level section group. Title + optional description, then children. +// Settings renders as a floating preferences card (see SettingsMain), so each +// section is its own card: one hairline-bordered surface with a quiet header, +// and the rows inside keep dividing themselves with hairlines. export function SettingSection({ title, description, @@ -176,33 +178,27 @@ export function SettingSection({ children: React.ReactNode; }) { return ( -
-
-

+
+
+

{title}

{description && ( -

+

{description}

)}
- {/* A rule, not a box. The app divides with hairlines and whitespace — - a bordered, tinted panel around rows that already separate - themselves with hairlines was dividing the same content twice. The - top rule is what tells a section where it starts, and it has to live - here rather than on the first row because sections also hold custom - content (theme tiles, previews) that draws no rule of its own. */} -
- {children} -
+
{children}
); } // Page heading shared across settings sub-pages. The global Save Draft / Apply // toolbar (which also shows where this module persists to) lives above this, so -// each page just owns its title row. +// each page just owns its title row. Settings is a compact preferences card, +// not a feature page: the heading stays at card scale (20px) instead of the +// 30/32px feature-page title, which is scoped to `.dt-page-title`. export function SettingsPageHeader({ title, description, @@ -216,6 +212,32 @@ export function SettingsPageHeader({ actions?: React.ReactNode; }) { return ( - +
+
+

+ {title} +

+ {description && ( +

+ {description} +

+ )} +
+ {actions && ( +
+ {actions} +
+ )} +
); }