Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
feat(desktop): 设置拆出「外观」栏目
kirozenge23e3f3f77b0
diff --git a/apps/desktop/help-knowledge/appearance.md b/apps/desktop/help-knowledge/appearance.mdindex 316ef454f4..076c14c931 100644--- a/apps/desktop/help-knowledge/appearance.md+++ b/apps/desktop/help-knowledge/appearance.md@@ -1,16 +1,15 @@---id: appearance-title: Appearance, theme, language and notifications-summary: Theme, theme family, fonts, display language, and desktop / FeiShu notifications — all in Settings > General.-tab: general+title: Appearance, theme, wallpaper and fonts+summary: Theme, theme family, wallpaper, fonts, sidebar styles, panel layout, and reply animation — all in Settings > Appearance.+tab: appearance----Settings > General controls how the app looks and how it notifies you.+Settings > Appearance controls how the app looks. It starts with the theme and appearance mode, followed by Wallpaper, Fonts, Sidebar & panels, and Reply Animation. Display language and notifications stay in Settings > General (see the language and notifications topic).-**Appearance:**--- **Theme**: light, dark, or system (follows your OS).-- **Theme family**: pick from the registered theme families; each family supplies its own colors for light and dark. The app uses a VSCode-style token system (see docs/design-rules/cindy-design-system.md) so themes only override what they need.+- **Theme**: pick from the registered theme families; each family supplies its own colors for light and dark. The app uses a VSCode-style token system (see docs/design-rules/cindy-design-system.md) so themes only override what they need. Families with only one variant are tagged Light only / Dark only; while one is selected the appearance mode is fixed to that variant, and your saved mode returns when you pick a two-variant theme.+- **Appearance mode**: light, dark, or system (follows your OS).+- **Wallpaper**: choose a Cindy scene, your own image, or a video for the whole app. The wallpaper is independent of the theme.- **Fonts**: choose fonts and sizes for interface text and code. Code font size changes code blocks, change comparisons, and editors; inline code, status numbers, badges, and path labels keep their size.- **Pinned Style**: show pinned sessions as Text, Cards, or List. **List Style** controls unpinned sessions: Text uses one line; List adds a preview.- **Local theme brand identity**: this is an optional power-user feature configured in the local theme JSON. The settings page intentionally keeps only create-copy, open-folder, and refresh actions. New copies include self-explanatory example paths directly in the JSON.@@ -27,16 +26,10 @@ Settings > General controls how the app looks and how it notifies you.The example filenames describe the final display areas; source images may be exported at 2x/3x while keeping the same aspect ratios. Paths must be absolute JSON strings; spaces do not need shell quotes. PNG, JPEG, and WebP are supported. Transparent padding is trimmed at render time without changing the source file. Only `brand.icon` and `brand.logo` are recognized; the previous single-image fields are not compatible with the redesigned two-asset layout.-**Language:**--- Display language: System / English / 简体中文 / 繁體中文 / 日本語 / 한국어. Used for the interface and AI error reports. Other replies follow your message or language request. On mobile, the phone's display language is used for AI error reports for messages sent from that phone.--**Notifications:**--- **System Notifications** — notify when a session finishes, encounters an error, or needs a reply. Regular sessions notify only while the window is in the background. When Agent Island is enabled, it handles these alerts instead.-- **FeiShu DM on session finished** — requires the FeiShu bot to be configured (see the FeiShu bot topic).+- **Plugin panel restore entry**: choose whether minimized plugin panels come back from a floating bubble or from the sidebar.+- **Panel layout**: panel positions and widths are saved automatically; **Restore default layout** puts them back.+- **Reply Animation**: new reply text fades in while it streams. Turn it off to show text immediately. It stays off when your system reduces motion.**Notes:**- Theme changes apply immediately; no restart needed.-- Language changes apply immediately, but a few static strings may need a window reload to update.diff --git a/apps/desktop/help-knowledge/feishu-bot.md b/apps/desktop/help-knowledge/feishu-bot.mdindex d5b9058ff4..3c534558dc 100644--- a/apps/desktop/help-knowledge/feishu-bot.md+++ b/apps/desktop/help-knowledge/feishu-bot.md@@ -19,7 +19,7 @@ Cindy can send DMs and take commands through a FeiShu (Lark) bot. (This is unrel**Notifications:**- Toggle **message notifications** on the same page to get bot DMs when sessions finish, or when the bot has updates for you.-- **System Notifications** is a separate toggle in **Settings > General > Notifications**. It covers sessions finishing, encountering an error, or needing a reply. See the appearance topic for background-window and Agent Island behavior.+- **System Notifications** is a separate toggle in **Settings > General > Notifications**. It covers sessions finishing, encountering an error, or needing a reply. See the language and notifications topic for background-window and Agent Island behavior.**Group chats:**diff --git a/apps/desktop/help-knowledge/language-and-notifications.md b/apps/desktop/help-knowledge/language-and-notifications.mdnew file mode 100644index 0000000000..9a16fbe163--- /dev/null+++ b/apps/desktop/help-knowledge/language-and-notifications.md@@ -0,0 +1,21 @@+---+id: language-and-notifications+title: Display language and notifications+summary: Display language and desktop / FeiShu notifications — in Settings > General.+tab: general+---++Settings > General controls the display language and how the app notifies you. Theme, wallpaper, and fonts live in Settings > Appearance (see the appearance topic).++**Language:**++- Display language: System / English / 简体中文 / 繁體中文 / 日本語 / 한국어. Used for the interface and AI error reports. Other replies follow your message or language request. On mobile, the phone's display language is used for AI error reports for messages sent from that phone.++**Notifications:**++- **System Notifications** — notify when a session finishes, encounters an error, or needs a reply. Regular sessions notify only while the window is in the background. When Agent Island is enabled, it handles these alerts instead.+- **FeiShu DM on session finished** — requires the FeiShu bot to be configured (see the FeiShu bot topic).++**Notes:**++- Language changes apply immediately, but a few static strings may need a window reload to update.diff --git a/apps/desktop/scripts/gen-help-kb.mjs b/apps/desktop/scripts/gen-help-kb.mjsindex c6411bb213..d548967cc3 100644--- a/apps/desktop/scripts/gen-help-kb.mjs+++ b/apps/desktop/scripts/gen-help-kb.mjs@@ -14,6 +14,7 @@ const OUT = resolve(here, '../src/main/maker-ipc/helpKnowledge.generated.ts');// Must stay in sync with HelpTabId in src/shared/helpTypes.ts.const ALLOWED_TABS = new Set(['general',+ 'appearance','personalization','api-keys','providers',diff --git a/apps/desktop/src/main/__tests__/helpRouting.test.ts b/apps/desktop/src/main/__tests__/helpRouting.test.tsindex ea67d4ea9b..fb653aa7ce 100644--- a/apps/desktop/src/main/__tests__/helpRouting.test.ts+++ b/apps/desktop/src/main/__tests__/helpRouting.test.ts@@ -80,6 +80,7 @@ describe('HELP_KNOWLEDGE invariants', () => {// shared/helpTypes.ts). Keep in sync when the deep-link whitelist changes.const ALLOWED = new Set(['general',+ 'appearance','personalization','api-keys','providers',diff --git a/apps/desktop/src/main/maker-ipc/help.ts b/apps/desktop/src/main/maker-ipc/help.tsindex bb9c3dde30..12579b62e7 100644--- a/apps/desktop/src/main/maker-ipc/help.ts+++ b/apps/desktop/src/main/maker-ipc/help.ts@@ -33,6 +33,7 @@ const log = createLogger('maker-ipc/help');// trusted to invent tab ids (CLAUDE.md rule 16: deterministic check in code).const ALLOWED_TABS = new Set<HelpTabId>(['general',+ 'appearance','personalization','api-keys','providers',diff --git a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.tsindex 71f6d90b1d..4c99887e1b 100644--- a/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts+++ b/apps/desktop/src/main/maker-ipc/helpKnowledge.generated.ts@@ -13,10 +13,10 @@ export interface HelpKnowledgeDoc {export const HELP_KNOWLEDGE: HelpKnowledgeDoc[] = [{id: "appearance",- title: "Appearance, theme, language and notifications",- summary: "Theme, theme family, fonts, display language, and desktop / FeiShu notifications — all in Settings > General.",- tab: "general",- content: "Settings > General controls how the app looks and how it notifies you.\n\n**Appearance:**\n\n- **Theme**: light, dark, or system (follows your OS).\n- **Theme family**: pick from the registered theme families; each family supplies its own colors for light and dark. The app uses a VSCode-style token system (see docs/design-rules/cindy-design-system.md) so themes only override what they need.\n- **Fonts**: choose fonts and sizes for interface text and code. Code font size changes code blocks, change comparisons, and editors; inline code, status numbers, badges, and path labels keep their size.\n- **Pinned Style**: show pinned sessions as Text, Cards, or List. **List Style** controls unpinned sessions: Text uses one line; List adds a preview.\n- **Local theme brand identity**: this is an optional power-user feature configured in the local theme JSON. The settings page intentionally keeps only create-copy, open-folder, and refresh actions. New copies include self-explanatory example paths directly in the JSON.\n- **Export / open local theme files**: export the current theme's tokens to a file or open a local theme JSON for inspection / sharing. To replace the icon and logo used on the new-chat page:\n\n ```json\n {\n \"brand\": {\n \"icon\": \"/absolute/path/to/your-image-folder/icon-square-50x50px.png\",\n \"logo\": \"/absolute/path/to/your-image-folder/logo-horizontal-110x37.5px.png\"\n }\n }\n ```\n\n The example filenames describe the final display areas; source images may be exported at 2x/3x while keeping the same aspect ratios. Paths must be absolute JSON strings; spaces do not need shell quotes. PNG, JPEG, and WebP are supported. Transparent padding is trimmed at render time without changing the source file. Only `brand.icon` and `brand.logo` are recognized; the previous single-image fields are not compatible with the redesigned two-asset layout.\n\n**Language:**\n\n- Display language: System / English / 简体中文 / 繁體中文 / 日本語 / 한국어. Used for the interface and AI error reports. Other replies follow your message or language request. On mobile, the phone's display language is used for AI error reports for messages sent from that phone.\n\n**Notifications:**\n\n- **System Notifications** — notify when a session finishes, encounters an error, or needs a reply. Regular sessions notify only while the window is in the background. When Agent Island is enabled, it handles these alerts instead.\n- **FeiShu DM on session finished** — requires the FeiShu bot to be configured (see the FeiShu bot topic).\n\n**Notes:**\n\n- Theme changes apply immediately; no restart needed.\n- Language changes apply immediately, but a few static strings may need a window reload to update.",+ title: "Appearance, theme, wallpaper and fonts",+ summary: "Theme, theme family, wallpaper, fonts, sidebar styles, panel layout, and reply animation — all in Settings > Appearance.",+ tab: "appearance",+ content: "Settings > Appearance controls how the app looks. It starts with the theme and appearance mode, followed by Wallpaper, Fonts, Sidebar & panels, and Reply Animation. Display language and notifications stay in Settings > General (see the language and notifications topic).\n\n- **Theme**: pick from the registered theme families; each family supplies its own colors for light and dark. The app uses a VSCode-style token system (see docs/design-rules/cindy-design-system.md) so themes only override what they need. Families with only one variant are tagged Light only / Dark only; while one is selected the appearance mode is fixed to that variant, and your saved mode returns when you pick a two-variant theme.\n- **Appearance mode**: light, dark, or system (follows your OS).\n- **Wallpaper**: choose a Cindy scene, your own image, or a video for the whole app. The wallpaper is independent of the theme.\n- **Fonts**: choose fonts and sizes for interface text and code. Code font size changes code blocks, change comparisons, and editors; inline code, status numbers, badges, and path labels keep their size.\n- **Pinned Style**: show pinned sessions as Text, Cards, or List. **List Style** controls unpinned sessions: Text uses one line; List adds a preview.\n- **Local theme brand identity**: this is an optional power-user feature configured in the local theme JSON. The settings page intentionally keeps only create-copy, open-folder, and refresh actions. New copies include self-explanatory example paths directly in the JSON.\n- **Export / open local theme files**: export the current theme's tokens to a file or open a local theme JSON for inspection / sharing. To replace the icon and logo used on the new-chat page:\n\n ```json\n {\n \"brand\": {\n \"icon\": \"/absolute/path/to/your-image-folder/icon-square-50x50px.png\",\n \"logo\": \"/absolute/path/to/your-image-folder/logo-horizontal-110x37.5px.png\"\n }\n }\n ```\n\n The example filenames describe the final display areas; source images may be exported at 2x/3x while keeping the same aspect ratios. Paths must be absolute JSON strings; spaces do not need shell quotes. PNG, JPEG, and WebP are supported. Transparent padding is trimmed at render time without changing the source file. Only `brand.icon` and `brand.logo` are recognized; the previous single-image fields are not compatible with the redesigned two-asset layout.\n\n- **Plugin panel restore entry**: choose whether minimized plugin panels come back from a floating bubble or from the sidebar.\n- **Panel layout**: panel positions and widths are saved automatically; **Restore default layout** puts them back.\n- **Reply Animation**: new reply text fades in while it streams. Turn it off to show text immediately. It stays off when your system reduces motion.\n\n**Notes:**\n\n- Theme changes apply immediately; no restart needed.",},{id: "attachments",@@ -47,7 +47,7 @@ export const HELP_KNOWLEDGE: HelpKnowledgeDoc[] = [title: "Setting up the FeiShu (Lark) bot",summary: "Configure the FeiShu bot (App ID / App Secret) in Settings > IM bots to get DM notifications and bot interaction.",tab: "im-bot",- content: "Cindy can send DMs and take commands through a FeiShu (Lark) bot. (This is unrelated to signing into Cindy — you sign in with your Cindy account; FeiShu is no longer a login method.)\n\n**Setting up the bot:**\n\n- Open Settings > IM bots, then the FeiShu Bot section.\n- Paste the bot's **App ID** and **App Secret**, then click **Bind**.\n- The status badge updates: **needs-config** → **connecting** → **connected** (or **conflict** / **error**).\n\n**Binding the bot to you:**\n\n- After the badge shows **connected**, the page instructs you to DM the bot a code (or click an action) to complete the binding. Until you bind, the bot won't know which FeiShu user to DM.\n\n**Notifications:**\n\n- Toggle **message notifications** on the same page to get bot DMs when sessions finish, or when the bot has updates for you.\n- **System Notifications** is a separate toggle in **Settings > General > Notifications**. It covers sessions finishing, encountering an error, or needing a reply. See the appearance topic for background-window and Agent Island behavior.\n\n**Group chats:**\n\n- In a group, @ the bot to ask a question. The bot opens a new thread (话题) for the reply — the main stream stays clean and each thread is its own session, like Slack threads.\n- The bot pages back through recent chat history (newest first, until the messages stop being relevant to your question) and answers with that history as context — including images and files shared in the chat. For a fresh thread opened from the main stream, the context still comes from the main stream history.\n- @-ing the bot inside an existing thread uses that thread's own history as context.\n- Thread sessions are titled `[飞书·{group name}·{topic summary}] {id suffix}` in the sidebar.\n\n**Permissions for group features:**\n\nGroup chat context needs an extra app permission that is not part of the default setup:\n\n1. Open the **FeiShu (Lark) Open Platform** → Developer Console → your app → **Permissions & Scopes** (权限管理).\n2. Search for and enable **both** of the following (searching by the scope id works regardless of the console language):\n - **\"Read all messages in associated group chat\" (获取群组中所有消息, `im:message.group_msg`)** — pulls the chat history via API.\n - **\"Read user and bot messages in group chats\" (获取群组中用户和机器人消息, `im:message.group_msg.include_bot:read`)** — needed for group message events, so the history covers messages from other bots too.\n These are sensitive permissions: on FeiShu they are only available to self-built apps (自建应用), not store apps.\n3. Create and publish a new app **version** (self-built apps need admin approval).\n\nWithout it the bot still answers when @-ed, but with no chat context, and it DMs the owner a one-line heads-up pointing here. Optionally, enabling **\"Obtain basic group information\" (获取群基本信息, `im:chat:readonly`)** lets session titles show the real group name instead of an id suffix.\n\n**Notes:**\n\n- The \"conflict\" badge state means another Cindy instance is already bound to the same bot for this user — typical when running dev + release simultaneously. Disconnect on one side to clear it.\n- Settings > IM bots also hosts the Slack and Telegram bindings (the \"Cindy\" tab) and a bring-your-own Discord bot, alongside this FeiShu bot.",+ content: "Cindy can send DMs and take commands through a FeiShu (Lark) bot. (This is unrelated to signing into Cindy — you sign in with your Cindy account; FeiShu is no longer a login method.)\n\n**Setting up the bot:**\n\n- Open Settings > IM bots, then the FeiShu Bot section.\n- Paste the bot's **App ID** and **App Secret**, then click **Bind**.\n- The status badge updates: **needs-config** → **connecting** → **connected** (or **conflict** / **error**).\n\n**Binding the bot to you:**\n\n- After the badge shows **connected**, the page instructs you to DM the bot a code (or click an action) to complete the binding. Until you bind, the bot won't know which FeiShu user to DM.\n\n**Notifications:**\n\n- Toggle **message notifications** on the same page to get bot DMs when sessions finish, or when the bot has updates for you.\n- **System Notifications** is a separate toggle in **Settings > General > Notifications**. It covers sessions finishing, encountering an error, or needing a reply. See the language and notifications topic for background-window and Agent Island behavior.\n\n**Group chats:**\n\n- In a group, @ the bot to ask a question. The bot opens a new thread (话题) for the reply — the main stream stays clean and each thread is its own session, like Slack threads.\n- The bot pages back through recent chat history (newest first, until the messages stop being relevant to your question) and answers with that history as context — including images and files shared in the chat. For a fresh thread opened from the main stream, the context still comes from the main stream history.\n- @-ing the bot inside an existing thread uses that thread's own history as context.\n- Thread sessions are titled `[飞书·{group name}·{topic summary}] {id suffix}` in the sidebar.\n\n**Permissions for group features:**\n\nGroup chat context needs an extra app permission that is not part of the default setup:\n\n1. Open the **FeiShu (Lark) Open Platform** → Developer Console → your app → **Permissions & Scopes** (权限管理).\n2. Search for and enable **both** of the following (searching by the scope id works regardless of the console language):\n - **\"Read all messages in associated group chat\" (获取群组中所有消息, `im:message.group_msg`)** — pulls the chat history via API.\n - **\"Read user and bot messages in group chats\" (获取群组中用户和机器人消息, `im:message.group_msg.include_bot:read`)** — needed for group message events, so the history covers messages from other bots too.\n These are sensitive permissions: on FeiShu they are only available to self-built apps (自建应用), not store apps.\n3. Create and publish a new app **version** (self-built apps need admin approval).\n\nWithout it the bot still answers when @-ed, but with no chat context, and it DMs the owner a one-line heads-up pointing here. Optionally, enabling **\"Obtain basic group information\" (获取群基本信息, `im:chat:readonly`)** lets session titles show the real group name instead of an id suffix.\n\n**Notes:**\n\n- The \"conflict\" badge state means another Cindy instance is already bound to the same bot for this user — typical when running dev + release simultaneously. Disconnect on one side to clear it.\n- Settings > IM bots also hosts the Slack and Telegram bindings (the \"Cindy\" tab) and a bring-your-own Discord bot, alongside this FeiShu bot.",},{id: "getting-started",@@ -68,6 +68,13 @@ export const HELP_KNOWLEDGE: HelpKnowledgeDoc[] = [summary: "Supported external services — FeiShu, Slack, Telegram, Discord, Google, Jira / Confluence, GitHub, GitLab — and what's not supported.",content: "At a glance, Cindy integrates with:\n\n- **FeiShu (Lark)** — DM-style bot notifications and interaction (Settings > IM bots). See the FeiShu bot topic. (FeiShu is no longer a sign-in method for Cindy itself.)\n- **Slack** — Settings > IM bots (the \"Cindy\" tab) manages workspace connections. With a compatible server, **Slack Communications on This Device** enables agent tools (search / read history / post as the authorized user) independently on multiple devices; Bot chats and tasks still go to a single receiving device. Enabling communications does not change that receiver.\n- **Telegram** — link your Telegram account to the official Cindy bot under Settings > IM bots (the \"Cindy\" tab). No bot token is required. Telegram tasks use the same local projects and Cindy sessions as Slack, while keeping channel-specific project and model preferences separate.\n- **Discord** — a Discord bot you bring yourself (your own Discord App + bot token) under Settings > IM bots.\n- **Google** — Gmail / Calendar / Drive / Sheets, via the Filo Google plugin (Plugins > Filo Google).\n- **GitHub / GitLab** — via the Cindy GitHub and Cindy GitLab plugins (Plugins).\n- **The coding agents** — Claude Code and Codex can reach pay-per-token models through **Cindy AI** in Settings > Model Providers.\n\n**Not supported:**\n\n- There is no built-in Microsoft Teams integration. For chat notifications, use the FeiShu, Slack, Telegram, or Discord bot.\n- There's no native Linear integration as a first-party feature — those would have to come via an MCP a user installs themselves.\n\n**Notes:**\n\n- Most of these connections are accessed by the agents through their tools (plugins / MCPs), not directly by the desktop app. Connecting on the plugin detail page is what gives its tools access to your account.",},+ {+ id: "language-and-notifications",+ title: "Display language and notifications",+ summary: "Display language and desktop / FeiShu notifications — in Settings > General.",+ tab: "general",+ content: "Settings > General controls the display language and how the app notifies you. Theme, wallpaper, and fonts live in Settings > Appearance (see the appearance topic).\n\n**Language:**\n\n- Display language: System / English / 简体中文 / 繁體中文 / 日本語 / 한국어. Used for the interface and AI error reports. Other replies follow your message or language request. On mobile, the phone's display language is used for AI error reports for messages sent from that phone.\n\n**Notifications:**\n\n- **System Notifications** — notify when a session finishes, encounters an error, or needs a reply. Regular sessions notify only while the window is in the background. When Agent Island is enabled, it handles these alerts instead.\n- **FeiShu DM on session finished** — requires the FeiShu bot to be configured (see the FeiShu bot topic).\n\n**Notes:**\n\n- Language changes apply immediately, but a few static strings may need a window reload to update.",+ },{id: "memory",title: "Memory across conversations",diff --git a/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx b/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsxindex e099dc897b..3ef4aea4ec 100644--- a/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx+++ b/apps/desktop/src/renderer/components/chat/MarkdownRenderer.tsx@@ -1684,7 +1684,7 @@ export const MarkdownRenderer = memo(function MarkdownRenderer({// 流式逐词淡入(DESIGN.md §14.4):消息级 state 跨 parse / remount 保留,// 各稳定 Markdown 分片只维护自己的内容匹配状态,但共享同一条连续时间线。// isStreaming 翻 false 时整段回落到普通 Markdown,终版没有流式 span 包装。- // 用户开关(Settings → 个性化 → 流式动效,默认开)与 reduced-motion 取 AND:+ // 用户开关(Settings → 外观 → 回复动效,默认开)与 reduced-motion 取 AND:// 系统级减弱动效永远优先,开关只在 motion 允许的前提下再做个人选择。const reducedMotion = useReducedMotion();const streamFadeEnabled = useStreamFadeEnabled();diff --git a/apps/desktop/src/renderer/components/settings/AppearanceSection.settings-search.ts b/apps/desktop/src/renderer/components/settings/AppearanceSection.settings-search.tsindex 0fc7f34571..f9edd80b1a 100644--- a/apps/desktop/src/renderer/components/settings/AppearanceSection.settings-search.ts+++ b/apps/desktop/src/renderer/components/settings/AppearanceSection.settings-search.ts@@ -1,22 +1,27 @@import type { SettingsSearchModule } from './settingsSearchTypes';-/** Search entries owned by AppearanceSection. */+/** Search entries owned by the Appearance tab (AppearanceSection + StreamFadeSection). */export default {id: 'AppearanceSection',order: 30,entries: [- { id: 'settings.appearance.wallpaper.customChoose', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-wallpaper', titleKey: 'settings.appearance.wallpaper.options.custom', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.wallpaper.customHint' },- { id: 'settings.appearance.modeLabel', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-modeLabel', titleKey: 'settings.appearance.modeLabel', sectionKey: 'settings.sections.appearance' },- { id: 'settings.appearance.themeLabel', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-themeLabel', titleKey: 'settings.appearance.themeLabel', sectionKey: 'settings.sections.appearance' },- { id: 'settings.appearance.wallpaper.title', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-wallpaper', titleKey: 'settings.appearance.wallpaper.title', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.wallpaper.description' },- { id: 'settings.appearance.localThemes.title', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-localThemes-title', titleKey: 'settings.appearance.localThemes.title', sectionKey: 'settings.sections.appearance' },- { id: 'settings.appearance.font.uiFamily.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-font-uiFamily-label', titleKey: 'settings.appearance.font.uiFamily.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.font.uiFamily.description' },- { id: 'settings.appearance.font.uiSize.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-font-uiSize-label', titleKey: 'settings.appearance.font.uiSize.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.font.uiSize.description' },- { id: 'settings.appearance.font.codeFamily.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-font-codeFamily-label', titleKey: 'settings.appearance.font.codeFamily.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.font.codeFamily.description' },- { id: 'settings.appearance.font.codeSize.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-font-codeSize-label', titleKey: 'settings.appearance.font.codeSize.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.font.codeSize.description' },- { id: 'settings.appearance.sidebarCardMode.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-sidebarCardMode-label', titleKey: 'settings.appearance.sidebarCardMode.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.sidebarCardMode.hint' },- { id: 'settings.appearance.sidebarMainListMode.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-sidebarMainListMode-label', titleKey: 'settings.appearance.sidebarMainListMode.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.sidebarMainListMode.hint' },- { id: 'settings.appearance.ghostPanelRestore.label', fallbackTargetId: 'settings-search-target-general-appearance', tab: 'general', targetId: 'settings-search-settings-appearance-ghostPanelRestore-label', titleKey: 'settings.appearance.ghostPanelRestore.label', sectionKey: 'settings.sections.appearance', descriptionKey: 'settings.appearance.ghostPanelRestore.hint' },-+ // 'general.appearance' / 'personalization.streamFade' 是拆分前的旧 id,保留为别名供旧深链解析。+ { id: 'appearance', tab: 'appearance', targetId: 'settings-panel-appearance', titleKey: 'settings.tabs.appearance', sectionKey: 'settings.tabs.appearance', aliases: ['general.appearance'] },+ { id: 'appearance.fonts', tab: 'appearance', targetId: 'settings-search-target-appearance-fonts', titleKey: 'settings.appearance.font.title', sectionKey: 'settings.appearance.font.title' },+ { id: 'appearance.sidebar', tab: 'appearance', targetId: 'settings-search-target-appearance-sidebar', titleKey: 'settings.appearance.sidebarAndPanels', sectionKey: 'settings.appearance.sidebarAndPanels' },+ { id: 'settings.appearance.wallpaper.customChoose', fallbackTargetId: 'settings-search-target-appearance-wallpaper', tab: 'appearance', targetId: 'settings-search-settings-appearance-wallpaper', titleKey: 'settings.appearance.wallpaper.options.custom', sectionKey: 'settings.appearance.wallpaper.title', descriptionKey: 'settings.appearance.wallpaper.customHint' },+ { id: 'settings.appearance.modeLabel', fallbackTargetId: 'settings-search-target-appearance-theme', tab: 'appearance', targetId: 'settings-search-settings-appearance-modeLabel', titleKey: 'settings.appearance.modeLabel', sectionKey: 'settings.appearance.themeLabel' },+ { id: 'settings.appearance.themeLabel', fallbackTargetId: 'settings-search-target-appearance-theme', tab: 'appearance', targetId: 'settings-search-settings-appearance-themeLabel', titleKey: 'settings.appearance.themeLabel', sectionKey: 'settings.appearance.themeLabel' },+ { id: 'settings.appearance.wallpaper.title', fallbackTargetId: 'settings-search-target-appearance-wallpaper', tab: 'appearance', targetId: 'settings-search-settings-appearance-wallpaper', titleKey: 'settings.appearance.wallpaper.title', sectionKey: 'settings.appearance.wallpaper.title', descriptionKey: 'settings.appearance.wallpaper.description' },+ { id: 'settings.appearance.localThemes.title', fallbackTargetId: 'settings-search-target-appearance-theme', tab: 'appearance', targetId: 'settings-search-settings-appearance-localThemes-title', titleKey: 'settings.appearance.localThemes.title', sectionKey: 'settings.appearance.themeLabel' },+ { id: 'settings.appearance.font.uiFamily.label', fallbackTargetId: 'settings-search-target-appearance-fonts', tab: 'appearance', targetId: 'settings-search-settings-appearance-font-uiFamily-label', titleKey: 'settings.appearance.font.uiFamily.label', sectionKey: 'settings.appearance.font.title', descriptionKey: 'settings.appearance.font.uiFamily.description' },+ { id: 'settings.appearance.font.uiSize.label', fallbackTargetId: 'settings-search-target-appearance-fonts', tab: 'appearance', targetId: 'settings-search-settings-appearance-font-uiSize-label', titleKey: 'settings.appearance.font.uiSize.label', sectionKey: 'settings.appearance.font.title', descriptionKey: 'settings.appearance.font.uiSize.description' },+ { id: 'settings.appearance.font.codeFamily.label', fallbackTargetId: 'settings-search-target-appearance-fonts', tab: 'appearance', targetId: 'settings-search-settings-appearance-font-codeFamily-label', titleKey: 'settings.appearance.font.codeFamily.label', sectionKey: 'settings.appearance.font.title', descriptionKey: 'settings.appearance.font.codeFamily.description' },+ { id: 'settings.appearance.font.codeSize.label', fallbackTargetId: 'settings-search-target-appearance-fonts', tab: 'appearance', targetId: 'settings-search-settings-appearance-font-codeSize-label', titleKey: 'settings.appearance.font.codeSize.label', sectionKey: 'settings.appearance.font.title', descriptionKey: 'settings.appearance.font.codeSize.description' },+ { id: 'settings.appearance.sidebarCardMode.label', fallbackTargetId: 'settings-search-target-appearance-sidebar', tab: 'appearance', targetId: 'settings-search-settings-appearance-sidebarCardMode-label', titleKey: 'settings.appearance.sidebarCardMode.label', sectionKey: 'settings.appearance.sidebarAndPanels', descriptionKey: 'settings.appearance.sidebarCardMode.hint' },+ { id: 'settings.appearance.sidebarMainListMode.label', fallbackTargetId: 'settings-search-target-appearance-sidebar', tab: 'appearance', targetId: 'settings-search-settings-appearance-sidebarMainListMode-label', titleKey: 'settings.appearance.sidebarMainListMode.label', sectionKey: 'settings.appearance.sidebarAndPanels', descriptionKey: 'settings.appearance.sidebarMainListMode.hint' },+ { id: 'settings.appearance.ghostPanelRestore.label', fallbackTargetId: 'settings-search-target-appearance-sidebar', tab: 'appearance', targetId: 'settings-search-settings-appearance-ghostPanelRestore-label', titleKey: 'settings.appearance.ghostPanelRestore.label', sectionKey: 'settings.appearance.sidebarAndPanels', descriptionKey: 'settings.appearance.ghostPanelRestore.hint' },+ { id: 'appearance.streamFade', tab: 'appearance', targetId: 'settings-search-target-appearance-stream-fade', titleKey: 'settings.sections.streamFade', sectionKey: 'settings.sections.streamFade', aliases: ['personalization.streamFade'] },+ { id: 'settings.streamFade.label', fallbackTargetId: 'settings-search-target-appearance-stream-fade', tab: 'appearance', targetId: 'settings-search-target-appearance-stream-fade', titleKey: 'settings.streamFade.label', sectionKey: 'settings.sections.streamFade', aliases: ['fade in', '流式淡入'] },],} satisfies SettingsSearchModule;diff --git a/apps/desktop/src/renderer/components/settings/AppearanceSection.tsx b/apps/desktop/src/renderer/components/settings/AppearanceSection.tsxindex 1c584900e4..b77a9508db 100644--- a/apps/desktop/src/renderer/components/settings/AppearanceSection.tsx+++ b/apps/desktop/src/renderer/components/settings/AppearanceSection.tsx@@ -1,17 +1,16 @@import { useCallback, useEffect, useMemo, useState } from 'react';import { useTranslation } from 'react-i18next';+import * as Select from '@radix-ui/react-select';import { SegmentedControl } from '@/components/ui/segmented-control';import {- Sun,- Moon,- Monitor,ChevronDown,Check,Copy,FolderOpen,Import as ImportIcon,RefreshCw,+ RotateCcw,} from 'lucide-react';import type { LucideIcon } from 'lucide-react';@@ -28,16 +27,25 @@ import {import { useSidebarCardMode, useSidebarMainViewMode } from '@/hooks/useSidebarCardMode';import { useGhostPanelRestoreMode } from '@/hooks/useGhostPanelRestoreMode';import { getThemeFamilies, resolveFamilyVariant, type ThemeFamily } from '@/themes/families';+import { resolveThemeValue } from '@/themes/theme-service';+import type { Theme } from '@/themes/types';import { buildCopyFromTheme, onLocalThemesChange, refreshLocalThemes } from '@/themes/local-themes';import { toast } from '@/lib/toast';import { isLocalThemeId } from '../../../shared/local-themes';-import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover';import { Button } from '@/components/ui/button';import { Tip } from '@/components/ui/tooltip';import { Slider } from '@/components/ui/slider';import { extractIpcError } from '@/utils/ipcError';import { FontFamilyPicker, type FontPreset } from './FontFamilyPicker';import { LayoutResetControl } from './LayoutResetControl';+import {+ SETTINGS_CARD_CLASS,+ SETTINGS_ROW_CLASS,+ SETTINGS_ROW_DIVIDER_CLASS,+ SETTINGS_ROW_HINT_CLASS,+ SETTINGS_ROW_LABEL_CLASS,+ SETTINGS_SECTION_TITLE_CLASS,+} from './settingsRowClasses';import { WallpaperSection } from './WallpaperSection';const log = createLogger('settings/AppearanceSection');@@ -94,30 +102,107 @@ const CODE_FONT_PREVIEW_SAMPLE =' `Hello, ${name}!`.repeat(n);\n' +'if (greet("AI", 0).length !== 0) throw new Error("oops");';+/** 缩略图配色:取所选配色主题的真实 token,让三张预览随配色变化。 */+interface ModePalette {+ canvas: string;+ sidebar: string;+ line: string;+ field: string;+ send: string;+ ink: string;+}++function modePalette(theme: Theme): ModePalette {+ const dark = theme.type === 'dark';+ const value = (id: string, fallback: string) => resolveThemeValue(theme, id) ?? fallback;+ return {+ canvas: value('surface', dark ? '#121212' : '#F2F2ED'),+ sidebar: value('surface-chip', dark ? '#1D1D1D' : '#EEEEE9'),+ line: value('border-default', dark ? '#313131' : '#E4E4DF'),+ field: value('surface-elevated', dark ? '#1F1F1F' : '#FDFDF8'),+ send: value('text-primary', dark ? '#D4D4D4' : '#1A1A1A'),+ ink: value('text-tertiary', dark ? '#C1C1C1' : '#6B6B67'),+ };+}++/** 一张迷你 Cindy 窗口:左侧栏、右上用户消息、几行回复、底部输入框与发送键。 */+function ModeThumbnail({ palette }: { palette: ModePalette }) {+ const bar = 'absolute h-[2px] rounded-full';+ return (+ <span className="absolute inset-0" style={{ background: palette.canvas }} aria-hidden>+ <span+ className="absolute inset-y-0 left-0 w-[20px] border-r"+ style={{ background: palette.sidebar, borderColor: palette.line }}+ >+ <span+ className="absolute left-[7px] top-[7px] h-[6px] w-[6px] rounded-full"+ style={{ background: palette.ink, opacity: 0.55 }}+ />+ <span+ className={cn(bar, 'left-[5px] top-[18px] w-[10px]')}+ style={{ background: palette.ink, opacity: 0.3 }}+ />+ <span+ className={cn(bar, 'left-[5px] top-[23px] w-[8px]')}+ style={{ background: palette.ink, opacity: 0.3 }}+ />+ </span>+ <span+ className="absolute right-[8px] top-[8px] h-[7px] w-[30px] rounded-[3px]"+ style={{ background: palette.ink, opacity: 0.22 }}+ />+ <span+ className={cn(bar, 'left-[28px] top-[21px] w-[44px]')}+ style={{ background: palette.ink, opacity: 0.45 }}+ />+ <span+ className={cn(bar, 'left-[28px] top-[26px] w-[50px]')}+ style={{ background: palette.ink, opacity: 0.45 }}+ />+ <span+ className={cn(bar, 'left-[28px] top-[31px] w-[32px]')}+ style={{ background: palette.ink, opacity: 0.45 }}+ />+ <span+ className="absolute bottom-[6px] left-[26px] right-[6px] h-[11px] rounded-full border"+ style={{ background: palette.field, borderColor: palette.line }}+ >+ <span+ className="absolute right-[2px] top-1/2 h-[5px] w-[5px] -translate-y-1/2 rounded-full"+ style={{ background: palette.send }}+ />+ </span>+ </span>+ );+}+interface ThemeCardProps {value: ThemeOption;label: string;ariaLabel: string;- preview: React.ReactNode;+ light: ModePalette;+ dark: ModePalette;isSelected: boolean;onClick: () => void;onKeyDown: (e: React.KeyboardEvent) => void;- /** Theme-locked preview background (固定不跟随当前主题). Auto 卡片内部自带 split 背景时省略此项。 */- previewBg?: string;- /** Active 态描边色覆写。Auto 卡片在 split 背景上无法用纯黑/白,需显式传 Stone 等中灰。 */- activeRingColor?: string;+ /** 当前主题只有一种方案时,显示模式不可选。 */+ disabled?: boolean;}+/**+ * 显示模式缩略图:外圈 12px(2px 描边 + 2px 间隙)与内图 8px 同心;选中态外圈用+ * 现有 preview-border-active,未选中透明、悬停时显出普通描边。「跟随系统」左浅右深。+ */function ThemeCard({value,label,ariaLabel,- preview,+ light,+ dark,isSelected,onClick,onKeyDown,- previewBg,- activeRingColor,+ disabled = false,}: ThemeCardProps) {return (<button@@ -126,47 +211,45 @@ function ThemeCard({aria-checked={isSelected}aria-label={ariaLabel}tabIndex={isSelected ? 0 : -1}+ disabled={disabled}onClick={onClick}onKeyDown={onKeyDown}- className="flex flex-1 flex-col items-center gap-2"+ className="group flex flex-col items-center gap-1.5 rounded-xl outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)] disabled:opacity-60"data-theme-value={value}>- {/* Preview box — 72px tall, rounded 12, 1px Board / 2px active ring */}- <div+ <spanclassName={cn(- 'flex h-[72px] w-full items-center justify-center overflow-hidden rounded-xl',- 'transition-colors',- isSelected ? 'border-2' : 'border',+ 'block rounded-xl border-2 p-[2px] transition-colors',+ isSelected+ ? 'border-[var(--settings-theme-preview-border-active)]'+ : cn(+ 'border-transparent',+ !disabled && 'group-hover:border-[var(--settings-theme-preview-border)]',+ ),)}- style={{- backgroundColor: previewBg,- borderColor: isSelected- ? (activeRingColor ?? 'var(--settings-theme-preview-border-active)')- : 'var(--settings-theme-preview-border)',- }}>- {preview}- </div>-- {/* Label row — 13/500, Stone → active Pure Black/White; active has trailing dot */}- <div className="flex items-center gap-1"><span- className={cn(- 'text-13 font-medium transition-colors',- isSelected- ? 'text-[var(--settings-theme-label-active)]'- : 'text-[var(--settings-theme-label)]',- )}+ className="relative block h-[60px] w-[92px] overflow-hidden rounded-[8px] border"+ style={{ borderColor: 'var(--settings-theme-preview-border)' }}>- {label}+ <ModeThumbnail palette={value === 'dark' ? dark : light} />+ {value === 'system' ? (+ <span className="absolute inset-0" style={{ clipPath: 'inset(0 0 0 50%)' }}>+ <ModeThumbnail palette={dark} />+ </span>+ ) : null}</span>- {isSelected ? (- <span- className="h-1.5 w-1.5 rounded-full bg-[var(--settings-theme-label-active)]"- aria-hidden- />- ) : null}- </div>+ </span>+ <span+ className={cn(+ 'text-12 transition-colors',+ isSelected+ ? 'font-medium text-[var(--settings-theme-label-active)]'+ : 'text-[var(--settings-theme-label)]',+ )}+ >+ {label}+ </span></button>);}@@ -207,8 +290,29 @@ interface FamilyDropdownProps {selectedId: string;onSelect: (familyId: string) => void;getLabel: (family: ThemeFamily) => string;+ /** 只有浅色或只有深色方案的主题,在名称后标注「仅浅色 / 仅深色」。 */+ getVariantBadge: (family: ThemeFamily) => string | null;+}++function singleVariantType(family: ThemeFamily): 'light' | 'dark' | null {+ if (family.light && !family.dark) return 'light';+ if (!family.light && family.dark) return 'dark';+ return null;+}++function VariantBadge({ text }: { text: string | null }) {+ if (!text) return null;+ return (+ <span className="shrink-0 whitespace-nowrap rounded-full bg-[var(--surface-chip)] px-2 py-1 text-11 font-medium leading-none text-[var(--text-secondary)]">+ {text}+ </span>+ );}+/**+ * 主题选择:一行设置——左侧名称,右侧与「显示语言」同款的胶囊下拉(Radix Select,+ * 同尺寸、同展开面板与选中样式)。单方案主题在名称后标「仅浅色 / 仅深色」。+ */function FamilyDropdown({label,ariaLabel,@@ -216,88 +320,86 @@ function FamilyDropdown({selectedId,onSelect,getLabel,+ getVariantBadge,}: FamilyDropdownProps) {- const [open, setOpen] = useState(false);const selected = families.find((f) => f.id === selectedId) ?? families[0];return (- <div className="flex flex-col gap-2">- <p- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >+ <div className={cn(SETTINGS_ROW_CLASS, 'gap-6')}>+ <p className={cn(SETTINGS_ROW_LABEL_CLASS, 'min-w-0')} style={{ letterSpacing: '0.12px' }}>{label}</p>- <Popover open={open} onOpenChange={setOpen}>- <PopoverTrigger asChild>- <button- type="button"- aria-label={ariaLabel}- className={cn(- 'flex h-10 w-full items-center justify-between rounded-xl px-3',- 'border border-[var(--settings-input-border)]',- 'bg-[var(--settings-input-bg)] text-left',- 'transition-colors hover:bg-[var(--settings-menu-bg-hover)]',- )}- >- <span className="truncate text-13 font-medium text-[var(--settings-input-text)]">- {getLabel(selected)}- </span>- <ChevronDown size={14} className="shrink-0 text-[var(--settings-eye-icon)]" />- </button>- </PopoverTrigger>- <PopoverContent- side="bottom"- align="start"- sideOffset={6}- collisionPadding={8}+ <Select.Root value={selected.id} onValueChange={onSelect}>+ <Select.Trigger+ aria-label={ariaLabel}className={cn(- 'w-[var(--radix-popover-trigger-width)] rounded-xl p-2',- 'border border-[var(--settings-input-border)]',- 'bg-[var(--settings-theme-card-bg)]',+ 'flex h-9 w-[320px] max-w-full shrink-0 items-center justify-between gap-3 rounded-full border px-3.5 text-13 outline-none transition-colors',+ 'border-[var(--settings-input-border)] bg-[var(--settings-input-bg)] text-[var(--settings-input-text)]',+ 'hover:bg-[var(--settings-menu-bg-hover)] focus:ring-2 focus:ring-[var(--focus-ring-soft)]',)}>- <div className="flex flex-col gap-[2px]" role="listbox" aria-label={ariaLabel}>- {families.map((family) => {- const isSelected = selectedId === family.id;- return (- <button+ <span className="flex min-w-0 items-center gap-2 text-left">+ <span className="min-w-0 truncate">+ <Select.Value>{getLabel(selected)}</Select.Value>+ </span>+ <VariantBadge text={getVariantBadge(selected)} />+ </span>+ <Select.Icon asChild>+ <ChevronDown+ size={14}+ className="shrink-0 text-[var(--settings-eye-icon)]"+ aria-hidden="true"+ />+ </Select.Icon>+ </Select.Trigger>+ <Select.Portal>+ <Select.Content+ position="popper"+ side="bottom"+ align="start"+ sideOffset={6}+ className={cn(+ 'z-[10010] max-h-[18rem] w-[var(--radix-select-trigger-width)] min-w-[220px] overflow-y-auto rounded-xl p-2',+ 'border border-[var(--settings-input-border)] bg-[var(--settings-theme-card-bg)]',+ 'shadow-[var(--shadow-menu)]',+ )}+ >+ <Select.Viewport className="flex flex-col gap-[2px]">+ {families.map((family) => (+ <Select.Itemkey={family.id}- type="button"- role="option"- aria-selected={isSelected}- onClick={() => {- onSelect(family.id);- setOpen(false);- }}+ value={family.id}className={cn(- 'flex w-full items-center justify-between rounded-[8px] px-3 py-2',- 'transition-colors hover:bg-[var(--settings-menu-bg-hover)]',- isSelected && 'bg-[var(--settings-menu-bg-hover)]',+ 'flex h-9 w-full cursor-pointer select-none items-center justify-between gap-3 rounded-[8px] px-3 text-left text-13 outline-none transition-colors',+ 'text-[var(--settings-input-text)] data-[highlighted]:bg-[var(--settings-menu-bg-hover)]',+ 'data-[state=checked]:bg-[var(--settings-menu-bg-selected)] data-[state=checked]:text-[var(--settings-menu-text-selected)]',)}>- <span className="text-13 font-medium text-[var(--settings-input-text)]">- {getLabel(family)}+ <span className="flex min-w-0 items-center gap-2">+ <Select.ItemText className="min-w-0 truncate">+ {getLabel(family)}+ </Select.ItemText>+ <VariantBadge text={getVariantBadge(family)} /></span>- {isSelected ? (+ <Select.ItemIndicator><Checksize={16}className="shrink-0 text-[var(--settings-theme-icon-active)]"/>- ) : null}- </button>- );- })}- </div>- </PopoverContent>- </Popover>+ </Select.ItemIndicator>+ </Select.Item>+ ))}+ </Select.Viewport>+ </Select.Content>+ </Select.Portal>+ </Select.Root></div>);}export function AppearanceSection() {- const { theme, setTheme, familyId, setFamily, fallbackFromType } = useTheme();+ const { theme, setTheme, familyId, setFamily } = useTheme();const {uiFamily,codeFamily,@@ -476,406 +578,434 @@ export function AppearanceSection() {setUiSizeInput(String(uiSize));}, [uiSize, uiSizeInput, setUiSize]);- // 预览背景与图标色按选项「主题锁定」——Light 卡永远展示亮态,Dark 卡永远展示暗态,- // 不再跟随当前 theme,让三张卡片的预览语义一致(都展示选中后的实际外观)。- // Auto 卡片用 split 背景已经表达「双状态」,无需 previewBg。- const LIGHT_PREVIEW_BG = '#f8f8f6';- const DARK_PREVIEW_BG = '#1f1f1e';- // Auto 卡 active ring 在 split 背景上需要中灰才能两半都可见,避免纯黑/纯白被吞。- const AUTO_ACTIVE_RING = '#737373';-- // fallbackFromType = 'light': 用户要 light, 家族没 light, 已 fallback 到 dark- // → 提示 "xx 主题没有提供浅色方案"- // fallbackFromType = 'dark' : 反之- const noticeKey =- fallbackFromType === 'light'- ? 'settings.appearance.missingLightNotice'- : fallbackFromType === 'dark'- ? 'settings.appearance.missingDarkNotice'- : null;-+ // 三张缩略图按所选配色的浅 / 深方案上色;配色缺某一方案时用另一方案(此时模式已锁定)。+ const lightPalette = modePalette(resolveFamilyVariant(selectedFamily.id, 'light').theme);+ const darkPalette = modePalette(resolveFamilyVariant(selectedFamily.id, 'dark').theme);++ // 只有一种方案的主题:显示模式固定为该方案,模式卡片只读并按实际显示选中;+ // 用户保存的显示模式不改,换回双方案主题后照旧生效。+ const lockedType = singleVariantType(selectedFamily);+ const modeSelected = (option: ThemeOption) =>+ lockedType ? option === lockedType : theme === option;+ const getVariantBadge = (family: ThemeFamily) => {+ const only = singleVariantType(family);+ return only ? t(`settings.appearance.singleVariant.${only}Only`) : null;+ };++ // 「外观」已是独立分区,页内不再重复页名;按主题 / 壁纸 / 字体 / 侧边栏与面板分节,+ // 每节标题在卡片外,卡片内是带分割线的设置行(settingsRowClasses)。return (- <div className="flex flex-col gap-[14px]">- {/* Section title — outside the card */}- <h2 className="text-16 font-medium leading-[1.2] text-[var(--settings-section-title)]">+ <div className="flex flex-col gap-6">+ {/* 页面标题:比各节标题(16px)高一级,标题段 20px / 1.3 */}+ <h2 className="text-20 font-medium leading-[1.3] text-[var(--settings-section-title)]">{t('settings.appearance.title')}</h2>- {/* Theme card — rounded 12, Card bg, 1px Board, padding 20 */}- <div id="settings-search-settings-appearance-themeLabel"- className={cn(- 'flex flex-col gap-[14px] rounded-xl p-5',- 'bg-[var(--settings-theme-card-bg)]',- 'border border-[var(--settings-theme-card-border)]',- )}- >- {/* Appearance mode */}- <p id="settings-search-settings-appearance-modeLabel"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.modeLabel')}- </p>-- {/* Theme options — gap 12 */}- <div- className="flex gap-3"- role="radiogroup"- aria-label={t('settings.appearance.themeAriaLabel')}+ <div className="flex flex-col gap-[36px]">+ <section+ id="settings-search-target-appearance-theme"+ className="flex flex-col gap-[14px]"+ aria-label={t('settings.appearance.themeLabel')}>- <ThemeCard- value="light"- label={t('settings.appearance.theme.light')}- ariaLabel={t('settings.appearance.themeAria.light')}- previewBg={LIGHT_PREVIEW_BG}- preview={<Sun size={28} style={{ color: '#262626' }} />}- isSelected={theme === 'light'}- onClick={() => setTheme('light')}- onKeyDown={handleKeyDown}- />-- <ThemeCard- value="dark"- label={t('settings.appearance.theme.dark')}- ariaLabel={t('settings.appearance.themeAria.dark')}- previewBg={DARK_PREVIEW_BG}- preview={<Moon size={28} style={{ color: '#d4d4d4' }} />}- isSelected={theme === 'dark'}- onClick={() => setTheme('dark')}- onKeyDown={handleKeyDown}- />-- <ThemeCard- value="system"- label={t('settings.appearance.theme.system')}- ariaLabel={t('settings.appearance.themeAria.system')}- activeRingColor={AUTO_ACTIVE_RING}- preview={+ {/* 主题卡片紧接页面标题,不再另设节标题 */}+ <div id="settings-search-settings-appearance-themeLabel" className={SETTINGS_CARD_CLASS}>+ <FamilyDropdown+ label={t('settings.appearance.themeLabel')}+ ariaLabel={t('settings.appearance.themeAriaLabel')}+ families={families}+ selectedId={familyId}+ onSelect={setFamily}+ getLabel={getFamilyLabel}+ getVariantBadge={getVariantBadge}+ />++ <div className={SETTINGS_ROW_DIVIDER_CLASS} />++ {/* Appearance mode — 主题决定可用方案,故排在主题之后;左名称、右缩略图 */}+ <div className="cindy-segmented-row px-4 py-4">+ <div className="flex min-w-0 flex-col gap-1">+ <p+ id="settings-search-settings-appearance-modeLabel"+ className={SETTINGS_ROW_LABEL_CLASS}+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.modeLabel')}+ </p>+ {lockedType ? (+ <p className={SETTINGS_ROW_HINT_CLASS}>+ {t(`settings.appearance.singleVariant.${lockedType}Notice`, {+ name: selectedFamily.name,+ })}+ </p>+ ) : null}+ </div>+<div- className="flex h-full w-full items-center justify-center"- style={{- background:- 'linear-gradient(90deg, var(--settings-theme-auto-dark) 0%, var(--settings-theme-auto-dark) 50%, var(--settings-theme-auto-light) 50%, var(--settings-theme-auto-light) 100%)',- }}+ className="flex shrink-0 gap-3"+ role="radiogroup"+ aria-label={t('settings.appearance.modeLabel')}+ aria-disabled={lockedType ? true : undefined}>- {/* Monitor icon 用 Stone #737373,跨 split 两半都有足够对比度。 */}- <Monitor size={28} className="text-[var(--settings-theme-icon)]" />+ <ThemeCard+ value="light"+ label={t('settings.appearance.theme.light')}+ ariaLabel={t('settings.appearance.themeAria.light')}+ light={lightPalette}+ dark={darkPalette}+ isSelected={modeSelected('light')}+ disabled={lockedType !== null}+ onClick={() => setTheme('light')}+ onKeyDown={handleKeyDown}+ />++ <ThemeCard+ value="dark"+ label={t('settings.appearance.theme.dark')}+ ariaLabel={t('settings.appearance.themeAria.dark')}+ light={lightPalette}+ dark={darkPalette}+ isSelected={modeSelected('dark')}+ disabled={lockedType !== null}+ onClick={() => setTheme('dark')}+ onKeyDown={handleKeyDown}+ />++ <ThemeCard+ value="system"+ label={t('settings.appearance.theme.system')}+ ariaLabel={t('settings.appearance.themeAria.system')}+ light={lightPalette}+ dark={darkPalette}+ isSelected={modeSelected('system')}+ disabled={lockedType !== null}+ onClick={() => setTheme('system')}+ onKeyDown={handleKeyDown}+ /></div>- }- isSelected={theme === 'system'}- onClick={() => setTheme('system')}- onKeyDown={handleKeyDown}- />- </div>-- <FamilyDropdown- label={t('settings.appearance.themeLabel')}- ariaLabel={t('settings.appearance.themeAriaLabel')}- families={families}- selectedId={familyId}- onSelect={setFamily}- getLabel={getFamilyLabel}- />+ </div>- <div className="flex flex-col gap-2 pt-1">- <p id="settings-search-settings-appearance-localThemes-title"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.localThemes.title')}- </p>- <div className="flex flex-wrap gap-2">- <LocalThemeIconButton- icon={Copy}- label={t('settings.appearance.localThemes.export')}- onClick={() => {- void handleExport();- }}- />- <LocalThemeIconButton- icon={ImportIcon}- label={t('settings.appearance.localThemes.import')}- onClick={() => {- void handleImport();- }}- />- <LocalThemeIconButton- icon={FolderOpen}- label={t('settings.appearance.localThemes.openDir')}- onClick={() => {- void handleOpenDir();- }}- />- <LocalThemeIconButton- icon={RefreshCw}- label={t('settings.appearance.localThemes.refresh')}- onClick={() => {- void handleRefresh();- }}- />- </div>- </div>+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />- {noticeKey ? (- <p className="text-12 leading-[1.5] text-[var(--settings-section-sublabel)]">- {t(noticeKey, { name: selectedFamily.name })}- </p>- ) : null}- </div>+ <div className={cn(SETTINGS_ROW_CLASS, 'flex-wrap')}>+ <div className="flex min-w-0 flex-col gap-1">+ <p+ id="settings-search-settings-appearance-localThemes-title"+ className={SETTINGS_ROW_LABEL_CLASS}+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.localThemes.title')}+ </p>+ </div>+ <div className="flex flex-wrap gap-2">+ <LocalThemeIconButton+ icon={Copy}+ label={t('settings.appearance.localThemes.export')}+ onClick={() => {+ void handleExport();+ }}+ />+ <LocalThemeIconButton+ icon={ImportIcon}+ label={t('settings.appearance.localThemes.import')}+ onClick={() => {+ void handleImport();+ }}+ />+ <LocalThemeIconButton+ icon={FolderOpen}+ label={t('settings.appearance.localThemes.openDir')}+ onClick={() => {+ void handleOpenDir();+ }}+ />+ <LocalThemeIconButton+ icon={RefreshCw}+ label={t('settings.appearance.localThemes.refresh')}+ onClick={() => {+ void handleRefresh();+ }}+ />+ </div>+ </div>+ </div>+ </section>- <WallpaperSection />+ <WallpaperSection />- <div id="settings-search-settings-appearance-font-uiFamily-label"- className={cn(- 'flex flex-col gap-[14px] rounded-xl p-5',- 'bg-[var(--settings-theme-card-bg)]',- 'border border-[var(--settings-theme-card-border)]',- )}- >- <FontFamilyPicker- label={t('settings.appearance.font.uiFamily.label')}- description={t('settings.appearance.font.uiFamily.description')}- ariaLabel={t('settings.appearance.font.uiFamily.aria')}- value={uiFamily}- presets={UI_FONT_PRESETS}- previewSample={t('settings.appearance.font.previewSamples.ui')}- previewFallbackFamily="var(--app-font-ui-default)"- onChange={setUiFamily}- onReset={resetUiFamily}- />+ <section+ id="settings-search-target-appearance-fonts"+ className="flex flex-col gap-[14px]"+ aria-label={t('settings.appearance.font.title')}+ >+ <h3 className={SETTINGS_SECTION_TITLE_CLASS}>{t('settings.appearance.font.title')}</h3>++ <div className={SETTINGS_CARD_CLASS}>+ <div id="settings-search-settings-appearance-font-uiFamily-label" className="px-4 py-4">+ <FontFamilyPicker+ label={t('settings.appearance.font.uiFamily.label')}+ description={t('settings.appearance.font.uiFamily.description')}+ ariaLabel={t('settings.appearance.font.uiFamily.aria')}+ value={uiFamily}+ presets={UI_FONT_PRESETS}+ previewSample={t('settings.appearance.font.previewSamples.ui')}+ previewFallbackFamily="var(--app-font-ui-default)"+ onChange={setUiFamily}+ onReset={resetUiFamily}+ />+ </div>- <div className="h-px bg-[var(--settings-input-border)]" />+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />++ <div className="flex flex-col gap-3 px-4 py-4">+ <div className="flex items-start justify-between gap-3">+ <div className="min-w-0">+ <p+ id="settings-search-settings-appearance-font-uiSize-label"+ className="text-13 font-medium text-[var(--settings-section-sublabel)]"+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.font.uiSize.label')}+ </p>+ <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.font.uiSize.description')}+ </p>+ </div>+ <Tip text={t('settings.appearance.font.reset')}>+ <Button+ variant="secondary"+ className="w-8 px-0"+ type="button"+ aria-label={t('settings.appearance.font.reset')}+ onClick={resetUiSize}+ disabled={uiSize === DEFAULT_UI_FONT_SIZE}+ >+ <RotateCcw size={14} />+ </Button>+ </Tip>+ </div>- <div className="flex flex-col gap-3">- <div className="flex items-start justify-between gap-3">- <div className="min-w-0">- <p id="settings-search-settings-appearance-font-uiSize-label"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.font.uiSize.label')}- </p>- <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.font.uiSize.description')}- </p>+ <div className="flex items-center gap-3">+ <Slider+ min={12}+ max={24}+ step={1}+ value={[uiSize]}+ onValueChange={([next]) => {+ if (typeof next === 'number') setUiSize(next);+ }}+ aria-label={t('settings.appearance.font.uiSize.aria')}+ />+ <input+ type="number"+ aria-label={t('settings.appearance.font.uiSize.label')}+ min={12}+ max={24}+ step={1}+ value={uiSizeInput}+ onChange={(e) => setUiSizeInput(e.target.value)}+ onBlur={commitUiSizeInput}+ onKeyDown={(e) => {+ if (e.key === 'Enter') {+ commitUiSizeInput();+ e.currentTarget.blur();+ }+ }}+ className={cn(+ 'h-9 w-[72px] rounded-xl border px-3 text-right text-13 outline-none',+ 'border-[var(--settings-input-border)] bg-[var(--settings-input-bg)]',+ 'font-mono text-[var(--settings-input-text)]',+ 'focus:border-[var(--settings-input-border-focus)]',+ )}+ />+ </div></div>- <Tip text={t('settings.appearance.font.reset')}>- <Button- variant="secondary"- className="w-8 px-0"- type="button"- aria-label={t('settings.appearance.font.reset')}- onClick={resetUiSize}- disabled={uiSize === DEFAULT_UI_FONT_SIZE}- >- <RefreshCw size={14} />- </Button>- </Tip>- </div>- <div className="flex items-center gap-3">- <Slider- min={12}- max={24}- step={1}- value={[uiSize]}- onValueChange={([next]) => {- if (typeof next === 'number') setUiSize(next);- }}- aria-label={t('settings.appearance.font.uiSize.aria')}- />- <input- type="number"- aria-label={t('settings.appearance.font.uiSize.label')}- min={12}- max={24}- step={1}- value={uiSizeInput}- onChange={(e) => setUiSizeInput(e.target.value)}- onBlur={commitUiSizeInput}- onKeyDown={(e) => {- if (e.key === 'Enter') {- commitUiSizeInput();- e.currentTarget.blur();- }- }}- className={cn(- 'h-9 w-[72px] rounded-xl border px-3 text-right text-13 outline-none',- 'border-[var(--settings-input-border)] bg-[var(--settings-input-bg)]',- 'font-mono text-[var(--settings-input-text)]',- 'focus:border-[var(--settings-input-border-focus)]',- )}- />- </div>- </div>-- <div className="h-px bg-[var(--settings-input-border)]" />-- <div id="settings-search-settings-appearance-font-codeFamily-label">- <FontFamilyPicker- label={t('settings.appearance.font.codeFamily.label')}- description={t('settings.appearance.font.codeFamily.description')}- ariaLabel={t('settings.appearance.font.codeFamily.aria')}- value={codeFamily}- presets={CODE_FONT_PRESETS}- previewSample={CODE_FONT_PREVIEW_SAMPLE}- previewLanguage="typescript"- previewFallbackFamily="var(--app-font-code-default)"- onChange={setCodeFamily}- onReset={resetCodeFamily}- />- </div>-- <div className="h-px bg-[var(--settings-input-border)]" />-- <div className="flex flex-col gap-3">- <div className="flex items-start justify-between gap-3">- <div className="min-w-0">- <p id="settings-search-settings-appearance-font-codeSize-label"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.font.codeSize.label')}- </p>- <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.font.codeSize.description')}- </p>+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />++ <div+ id="settings-search-settings-appearance-font-codeFamily-label"+ className="px-4 py-4"+ >+ <FontFamilyPicker+ label={t('settings.appearance.font.codeFamily.label')}+ description={t('settings.appearance.font.codeFamily.description')}+ ariaLabel={t('settings.appearance.font.codeFamily.aria')}+ value={codeFamily}+ presets={CODE_FONT_PRESETS}+ previewSample={CODE_FONT_PREVIEW_SAMPLE}+ previewLanguage="typescript"+ previewFallbackFamily="var(--app-font-code-default)"+ onChange={setCodeFamily}+ onReset={resetCodeFamily}+ /></div>- <Tip text={t('settings.appearance.font.reset')}>- <Button- variant="secondary"- className="w-8 px-0"- type="button"- aria-label={t('settings.appearance.font.reset')}- onClick={resetCodeSize}- disabled={codeSize === DEFAULT_CODE_FONT_SIZE}- >- <RefreshCw size={14} />- </Button>- </Tip>- </div>- <div className="flex items-center gap-3">- <Slider- min={10}- max={24}- step={1}- value={[codeSize]}- onValueChange={([next]) => {- if (typeof next === 'number') setCodeSize(next);- }}- aria-label={t('settings.appearance.font.codeSize.aria')}- />- <input- type="number"- aria-label={t('settings.appearance.font.codeSize.label')}- min={10}- max={24}- step={1}- value={codeSizeInput}- onChange={(e) => setCodeSizeInput(e.target.value)}- onBlur={commitCodeSizeInput}- onKeyDown={(e) => {- if (e.key === 'Enter') {- commitCodeSizeInput();- e.currentTarget.blur();- }- }}- className={cn(- 'h-9 w-[72px] rounded-xl border px-3 text-right text-13 outline-none',- 'border-[var(--settings-input-border)] bg-[var(--settings-input-bg)]',- 'font-mono text-[var(--settings-input-text)]',- 'focus:border-[var(--settings-input-border-focus)]',- )}- />+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />++ <div className="flex flex-col gap-3 px-4 py-4">+ <div className="flex items-start justify-between gap-3">+ <div className="min-w-0">+ <p+ id="settings-search-settings-appearance-font-codeSize-label"+ className="text-13 font-medium text-[var(--settings-section-sublabel)]"+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.font.codeSize.label')}+ </p>+ <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.font.codeSize.description')}+ </p>+ </div>+ <Tip text={t('settings.appearance.font.reset')}>+ <Button+ variant="secondary"+ className="w-8 px-0"+ type="button"+ aria-label={t('settings.appearance.font.reset')}+ onClick={resetCodeSize}+ disabled={codeSize === DEFAULT_CODE_FONT_SIZE}+ >+ <RotateCcw size={14} />+ </Button>+ </Tip>+ </div>++ <div className="flex items-center gap-3">+ <Slider+ min={10}+ max={24}+ step={1}+ value={[codeSize]}+ onValueChange={([next]) => {+ if (typeof next === 'number') setCodeSize(next);+ }}+ aria-label={t('settings.appearance.font.codeSize.aria')}+ />+ <input+ type="number"+ aria-label={t('settings.appearance.font.codeSize.label')}+ min={10}+ max={24}+ step={1}+ value={codeSizeInput}+ onChange={(e) => setCodeSizeInput(e.target.value)}+ onBlur={commitCodeSizeInput}+ onKeyDown={(e) => {+ if (e.key === 'Enter') {+ commitCodeSizeInput();+ e.currentTarget.blur();+ }+ }}+ className={cn(+ 'h-9 w-[72px] rounded-xl border px-3 text-right text-13 outline-none',+ 'border-[var(--settings-input-border)] bg-[var(--settings-input-bg)]',+ 'font-mono text-[var(--settings-input-text)]',+ 'focus:border-[var(--settings-input-border-focus)]',+ )}+ />+ </div>+ </div></div>- </div>- </div>+ </section>- {/* Sidebar view modes — 置顶段(三态) / 主列表(两态)分离(sidebar-redesign B 期)。+ {/* Sidebar view modes — 置顶段(三态) / 主列表(两态)分离(sidebar-redesign B 期)。独立卡片,沿用 NotificationSection 的 label+hint+Switch 行模式。 */}- <div- className={cn(- 'flex flex-col gap-4 rounded-xl p-5',- 'bg-[var(--settings-theme-card-bg)]',- 'border border-[var(--settings-theme-card-border)]',- )}- >- <div className="cindy-segmented-row">- <div className="flex min-w-0 flex-col gap-1">- <p id="settings-search-settings-appearance-sidebarCardMode-label"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.sidebarCardMode.label')}- </p>- <p className="text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.sidebarCardMode.hint')}- </p>- </div>+ <section+ id="settings-search-target-appearance-sidebar"+ className="flex flex-col gap-[14px]"+ aria-label={t('settings.appearance.sidebarAndPanels')}+ >+ <h3 className={SETTINGS_SECTION_TITLE_CLASS}>+ {t('settings.appearance.sidebarAndPanels')}+ </h3>++ <div className={SETTINGS_CARD_CLASS}>+ <div className="cindy-segmented-row px-4 py-4">+ <div className="flex min-w-0 flex-col gap-1">+ <p+ id="settings-search-settings-appearance-sidebarCardMode-label"+ className="text-13 font-medium text-[var(--settings-section-sublabel)]"+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.sidebarCardMode.label')}+ </p>+ <p className="text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.sidebarCardMode.hint')}+ </p>+ </div>- <SegmentedControl- aria-label={t('settings.appearance.sidebarCardMode.aria')}- value={sidebarViewMode}- onValueChange={setSidebarViewMode}- options={[- { value: 'text', label: t('ccAgent.sidebar.viewStyleList') },- { value: 'card', label: t('ccAgent.sidebar.viewStyleCard') },- { value: 'list', label: t('ccAgent.sidebar.viewStyleListWide') },- ]}- />- </div>-- <div className="cindy-segmented-row">- <div className="flex min-w-0 flex-col gap-1">- <p id="settings-search-settings-appearance-sidebarMainListMode-label"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.sidebarMainListMode.label')}- </p>- <p className="text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.sidebarMainListMode.hint')}- </p>- </div>+ <SegmentedControl+ aria-label={t('settings.appearance.sidebarCardMode.aria')}+ value={sidebarViewMode}+ onValueChange={setSidebarViewMode}+ options={[+ { value: 'text', label: t('ccAgent.sidebar.viewStyleList') },+ { value: 'card', label: t('ccAgent.sidebar.viewStyleCard') },+ { value: 'list', label: t('ccAgent.sidebar.viewStyleListWide') },+ ]}+ />+ </div>- <SegmentedControl- aria-label={t('settings.appearance.sidebarMainListMode.aria')}- value={sidebarMainViewMode}- onValueChange={setSidebarMainViewMode}- options={[- { value: 'text', label: t('ccAgent.sidebar.viewStyleList') },- { value: 'list', label: t('ccAgent.sidebar.viewStyleListWide') },- ]}- />- </div>-- <div className="cindy-segmented-row">- <div className="flex min-w-0 flex-col gap-1">- <p id="settings-search-settings-appearance-ghostPanelRestore-label"- className="text-13 font-medium text-[var(--settings-section-sublabel)]"- style={{ letterSpacing: '0.12px' }}- >- {t('settings.appearance.ghostPanelRestore.label')}- </p>- <p className="text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.ghostPanelRestore.hint')}- </p>- </div>+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />- <SegmentedControl- aria-label={t('settings.appearance.ghostPanelRestore.aria')}- value={ghostPanelRestoreMode}- onValueChange={setGhostPanelRestoreMode}- options={[- { value: 'bubble', label: t('settings.appearance.ghostPanelRestore.bubble') },- { value: 'sidebar', label: t('settings.appearance.ghostPanelRestore.sidebar') },- ]}- />- </div>- </div>+ <div className="cindy-segmented-row px-4 py-4">+ <div className="flex min-w-0 flex-col gap-1">+ <p+ id="settings-search-settings-appearance-sidebarMainListMode-label"+ className="text-13 font-medium text-[var(--settings-section-sublabel)]"+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.sidebarMainListMode.label')}+ </p>+ <p className="text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.sidebarMainListMode.hint')}+ </p>+ </div>++ <SegmentedControl+ aria-label={t('settings.appearance.sidebarMainListMode.aria')}+ value={sidebarMainViewMode}+ onValueChange={setSidebarMainViewMode}+ options={[+ { value: 'text', label: t('ccAgent.sidebar.viewStyleList') },+ { value: 'list', label: t('ccAgent.sidebar.viewStyleListWide') },+ ]}+ />+ </div>- <LayoutResetControl />+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />++ <div className="cindy-segmented-row px-4 py-4">+ <div className="flex min-w-0 flex-col gap-1">+ <p+ id="settings-search-settings-appearance-ghostPanelRestore-label"+ className="text-13 font-medium text-[var(--settings-section-sublabel)]"+ style={{ letterSpacing: '0.12px' }}+ >+ {t('settings.appearance.ghostPanelRestore.label')}+ </p>+ <p className="text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.ghostPanelRestore.hint')}+ </p>+ </div>++ <SegmentedControl+ aria-label={t('settings.appearance.ghostPanelRestore.aria')}+ value={ghostPanelRestoreMode}+ onValueChange={setGhostPanelRestoreMode}+ options={[+ { value: 'bubble', label: t('settings.appearance.ghostPanelRestore.bubble') },+ { value: 'sidebar', label: t('settings.appearance.ghostPanelRestore.sidebar') },+ ]}+ />+ </div>++ <div className={SETTINGS_ROW_DIVIDER_CLASS} />++ <LayoutResetControl />+ </div>+ </section>+ </div></div>);}diff --git a/apps/desktop/src/renderer/components/settings/FontFamilyPicker.tsx b/apps/desktop/src/renderer/components/settings/FontFamilyPicker.tsxindex ddaaa0fa06..e2139e4017 100644--- a/apps/desktop/src/renderer/components/settings/FontFamilyPicker.tsx+++ b/apps/desktop/src/renderer/components/settings/FontFamilyPicker.tsx@@ -146,7 +146,7 @@ export function FontFamilyPicker({'transition-colors hover:bg-[var(--settings-menu-bg-hover)]',)}>- <span className="truncate text-13 font-medium text-[var(--settings-input-text)]">+ <span className="truncate text-13 text-[var(--settings-input-text)]">{selectedLabel}</span><ChevronDown size={14} className="shrink-0 text-[var(--settings-eye-icon)]" />@@ -210,7 +210,7 @@ export function FontFamilyPicker({)}><span- className="truncate text-13 font-medium text-[var(--settings-input-text)]"+ className="truncate text-13 text-[var(--settings-input-text)]"style={{ fontFamily: buildPreviewFamily(option.family) }}>{option.label}diff --git a/apps/desktop/src/renderer/components/settings/GeneralSettings.settings-search.ts b/apps/desktop/src/renderer/components/settings/GeneralSettings.settings-search.tsindex d091c589fb..4122ae9c09 100644--- a/apps/desktop/src/renderer/components/settings/GeneralSettings.settings-search.ts+++ b/apps/desktop/src/renderer/components/settings/GeneralSettings.settings-search.ts@@ -7,7 +7,6 @@ export default {entries: [{ id: 'general', tab: 'general', targetId: 'settings-panel-general', titleKey: 'settings.tabs.general', sectionKey: 'settings.tabs.general' },{ id: 'general.user', tab: 'general', targetId: 'settings-search-target-general-user', titleKey: 'settings.sections.user', sectionKey: 'settings.sections.user' },- { id: 'general.appearance', tab: 'general', targetId: 'settings-search-target-general-appearance', titleKey: 'settings.sections.appearance', sectionKey: 'settings.sections.appearance' },{ id: 'general.language', tab: 'general', targetId: 'settings-search-target-general-language', titleKey: 'settings.sections.language', sectionKey: 'settings.sections.language' },{ id: 'general.notifications', tab: 'general', targetId: 'settings-notifications', titleKey: 'settings.sections.notifications', sectionKey: 'settings.sections.notifications' },{ id: 'general.bots', tab: 'general', targetId: 'settings-bots', titleKey: 'settings.sections.bots', sectionKey: 'settings.sections.bots' },diff --git a/apps/desktop/src/renderer/components/settings/LanguageSection.tsx b/apps/desktop/src/renderer/components/settings/LanguageSection.tsxindex a178131ce9..da9d9c57d3 100644--- a/apps/desktop/src/renderer/components/settings/LanguageSection.tsx+++ b/apps/desktop/src/renderer/components/settings/LanguageSection.tsx@@ -31,7 +31,7 @@ export function LanguageSection() {<divclassName={cn(- 'flex flex-row items-center justify-between gap-6 rounded-xl p-5',+ 'flex flex-row items-center justify-between gap-6 rounded-xl px-4 py-4','bg-[var(--settings-theme-card-bg)]','border border-[var(--settings-theme-card-border)]',)}@@ -88,7 +88,7 @@ export function LanguageSection() {className={cn('flex h-9 w-full cursor-pointer select-none items-center justify-between gap-3 rounded-[8px] px-3 text-left text-13 outline-none transition-colors','text-[var(--settings-input-text)] data-[highlighted]:bg-[var(--settings-menu-bg-hover)]',- 'data-[state=checked]:bg-[var(--settings-menu-bg-selected)] data-[state=checked]:font-medium data-[state=checked]:text-[var(--settings-menu-text-selected)]',+ 'data-[state=checked]:bg-[var(--settings-menu-bg-selected)] data-[state=checked]:text-[var(--settings-menu-text-selected)]',)}><Select.ItemText className="min-w-0 truncate">diff --git a/apps/desktop/src/renderer/components/settings/LayoutResetControl.tsx b/apps/desktop/src/renderer/components/settings/LayoutResetControl.tsxindex f1627ddf77..68ae9e7b6f 100644--- a/apps/desktop/src/renderer/components/settings/LayoutResetControl.tsx+++ b/apps/desktop/src/renderer/components/settings/LayoutResetControl.tsx@@ -4,7 +4,7 @@ import { useState } from 'react';import { useTranslation } from 'react-i18next';import { toast } from '@/lib/toast';-import { cn } from '@/lib/utils';+import { SETTINGS_ROW_CLASS } from './settingsRowClasses';/** 正式版布局恢复入口:复用 main 的原子 reset + broadcast,不另存 renderer 状态。 */export function LayoutResetControl() {@@ -29,13 +29,7 @@ export function LayoutResetControl() {};return (- <div- className={cn(- 'flex items-center justify-between gap-3 rounded-xl p-5',- 'bg-[var(--settings-theme-card-bg)]',- 'border border-[var(--settings-theme-card-border)]',- )}- >+ <div className={SETTINGS_ROW_CLASS}><div className="flex min-w-0 flex-col gap-1"><pclassName="text-13 font-medium text-[var(--settings-section-sublabel)]"diff --git a/apps/desktop/src/renderer/components/settings/PersonalizationDetails.settings-search.ts b/apps/desktop/src/renderer/components/settings/PersonalizationDetails.settings-search.tsindex 8eba3a02b4..8289b9872c 100644--- a/apps/desktop/src/renderer/components/settings/PersonalizationDetails.settings-search.ts+++ b/apps/desktop/src/renderer/components/settings/PersonalizationDetails.settings-search.ts@@ -20,7 +20,6 @@ export default {{ id: 'settings.terminalShell.card.label', fallbackTargetId: 'settings-search-target-personalization-terminal-shell', tab: 'personalization', targetId: 'settings-search-target-personalization-terminal-shell', titleKey: 'settings.terminalShell.card.label', sectionKey: 'settings.sections.terminalShell', aliases: ['terminal', 'shell', '终端'] },{ id: 'settings.linkOpen.web.label', fallbackTargetId: 'settings-search-target-personalization-link-open', tab: 'personalization', targetId: 'settings-search-target-personalization-link-open', titleKey: 'settings.linkOpen.web.label', sectionKey: 'settings.sections.linkOpen', aliases: ['open in sidebar', '内置侧栏'] },{ id: 'settings.linkOpen.local.label', fallbackTargetId: 'settings-search-target-personalization-link-open', tab: 'personalization', targetId: 'settings-search-target-personalization-link-open', titleKey: 'settings.linkOpen.local.label', sectionKey: 'settings.sections.linkOpen', aliases: ['open externally', '系统浏览器'] },- { id: 'settings.streamFade.label', fallbackTargetId: 'settings-search-target-personalization-stream-fade', tab: 'personalization', targetId: 'settings-search-target-personalization-stream-fade', titleKey: 'settings.streamFade.label', sectionKey: 'settings.sections.streamFade', aliases: ['fade in', '流式淡入'] },{ id: 'settings.compatMode.title', fallbackTargetId: 'settings-search-target-personalization-tips', tab: 'personalization', targetId: 'settings-search-target-personalization-tips', titleKey: 'settings.compatMode.title', sectionKey: 'settings.sections.compatMode' },],} satisfies SettingsSearchModule;diff --git a/apps/desktop/src/renderer/components/settings/PersonalizationSettings.settings-search.ts b/apps/desktop/src/renderer/components/settings/PersonalizationSettings.settings-search.tsindex 6965abe9b2..70509a7941 100644--- a/apps/desktop/src/renderer/components/settings/PersonalizationSettings.settings-search.ts+++ b/apps/desktop/src/renderer/components/settings/PersonalizationSettings.settings-search.ts@@ -15,7 +15,6 @@ export default {{ id: 'personalization.compaction', tab: 'personalization', targetId: 'settings-search-target-personalization-compaction', titleKey: 'settings.sections.compaction', sectionKey: 'settings.sections.compaction' },{ id: 'personalization.terminalShell', tab: 'personalization', targetId: 'settings-search-target-personalization-terminal-shell', titleKey: 'settings.sections.terminalShell', sectionKey: 'settings.sections.terminalShell', aliases: ['terminal', 'shell', '终端'] },{ id: 'personalization.linkOpen', tab: 'personalization', targetId: 'settings-search-target-personalization-link-open', titleKey: 'settings.sections.linkOpen', sectionKey: 'settings.sections.linkOpen' },- { id: 'personalization.streamFade', tab: 'personalization', targetId: 'settings-search-target-personalization-stream-fade', titleKey: 'settings.sections.streamFade', sectionKey: 'settings.sections.streamFade' },{ id: 'personalization.tips', tab: 'personalization', targetId: 'settings-search-target-personalization-tips', titleKey: 'settings.sections.compatMode', sectionKey: 'settings.sections.compatMode' },],} satisfies SettingsSearchModule;diff --git a/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx b/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsxindex eace0d8bb7..3c9d56d5df 100644--- a/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx+++ b/apps/desktop/src/renderer/components/settings/SettingsSidebarNav.tsx@@ -15,6 +15,7 @@ import {Mic,MonitorCog,MonitorSmartphone,+ Palette,Plug,Settings2,Sparkles,@@ -63,6 +64,7 @@ type SettingsNavIcon = ComponentType<LucideProps>;const TAB_ICON: Record<VisibleSettingsTab, SettingsNavIcon> = {general: Settings2,+ appearance: Palette,billing: CircleDollarSign,usage: ChartColumn,personalization: Sparkles,diff --git a/apps/desktop/src/renderer/components/settings/SettingsView.tsx b/apps/desktop/src/renderer/components/settings/SettingsView.tsxindex ce89a05062..d678847ab1 100644--- a/apps/desktop/src/renderer/components/settings/SettingsView.tsx+++ b/apps/desktop/src/renderer/components/settings/SettingsView.tsx@@ -2,14 +2,21 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';import { Navigate, useNavigate, useOutletContext, useSearchParams } from 'react-router-dom';import { useTranslation } from 'react-i18next';import { useSyncExternalStore } from 'react';-import { ArrowLeft, ChevronRight, Puzzle } from 'lucide-react';+import { ArrowLeft, ChevronRight } from 'lucide-react';import { cn } from '@/lib/utils';import { Tip } from '@/components/ui/tooltip';import { TAB_IDS, isSettingsTab } from '@/lib/tabLabels';import type { SettingsTab } from '@/lib/tabLabels';import { SettingsSidebarNav } from './SettingsSidebarNav';-import { resolveSettingsSearchEntry } from './settingsSearchCatalog';+import { isLegacyAppearanceDeepLink, resolveSettingsSearchEntry } from './settingsSearchCatalog';+import {+ SETTINGS_CARD_CLASS,+ SETTINGS_ROW_CLASS,+ SETTINGS_ROW_HINT_CLASS,+ SETTINGS_ROW_LABEL_CLASS,+ SETTINGS_SECTION_TITLE_CLASS,+} from './settingsRowClasses';import { SettingsSearchNavigationContext } from './SettingsSearchNavigation';import type { SettingsSearchContext } from './settingsSearchTypes';import { useSettingsSectionTarget } from './useSettingsSectionTarget';@@ -85,6 +92,7 @@ export function SettingsView() {getLastWorkingDir,);const rawTab = searchParams.get('tab');+ const rawSection = searchParams.get('section');const canAccessBilling = canAccessBillingSettings({mode,membershipKind: user?.membershipKind ?? null,@@ -105,8 +113,10 @@ export function SettingsView() {if (raw === 'billing' && !canAccessBilling) return 'general';if (raw === 'usage' && !canAccessUsage) return 'general';if (raw === 'agent-island' && !isMac) return 'general';+ // legacy 深链:外观设置原在「通用」、回复动效原在「个性化」,旧 section 深链落到「外观」。+ if (isLegacyAppearanceDeepLink(raw, rawSection)) return 'appearance';return isSettingsTab(raw) ? raw : 'general';- }, [canAccessBilling, canAccessUsage, isMac, rawTab]);+ }, [canAccessBilling, canAccessUsage, isMac, rawSection, rawTab]);const piExtensionsPanelOpen =activeTab === 'general' &&(rawTab === 'pi-extensions' || searchParams.get('openPanel') === 'pi-extensions');@@ -349,38 +359,11 @@ export function SettingsView() {<UserProfileCard /></section>- {/* Section — Appearance (py 18) */}- <section id="settings-search-target-general-appearance" className="py-[18px]" aria-label={t('settings.sections.appearance')}>- <AppearanceSection />- </section>-{/* Section — Language (py 18) */}<section id="settings-search-target-general-language" className="py-[18px]" aria-label={t('settings.sections.language')}><LanguageSection /></section>- {/* Pi 扩展只在通用页提供一行入口,不占用设置一级菜单。 */}- <section id="settings-pi-extensions" className="py-[18px]" aria-label={t('settings.piPackages.entryTitle')}>- <button- type="button"- onClick={handleOpenPiExtensions}- className="flex w-full items-center gap-3 rounded-xl border border-[var(--settings-theme-card-border)] bg-[var(--settings-theme-card-bg)] px-5 py-4 text-left transition-colors hover:bg-[var(--settings-menu-bg-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]"- >- <span className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-[var(--settings-btn-secondary-border)] bg-[var(--surface)] text-[var(--settings-section-desc)]">- <Puzzle size={18} />- </span>- <span className="flex min-w-0 flex-1 flex-col gap-0.5">- <span className="text-14 font-medium leading-tight text-[var(--settings-section-title)]">- {t('settings.piPackages.entryTitle')}- </span>- <span className="text-13 leading-tight text-[var(--settings-integration-subtitle)]">- {t('settings.piPackages.entryDescription')}- </span>- </span>- <ChevronRight size={18} className="shrink-0 text-[var(--text-tertiary)]" />- </button>- </section>-{/* Section — Notifications (py 18) */}<sectionid="settings-notifications"@@ -390,16 +373,6 @@ export function SettingsView() {<NotificationSection /></section>- {/* Section — 伙伴(功能级设置:怎么提醒你 + 带走/接回一个伙伴)。- 单个伙伴的性格、记忆、能力与日程仍在 TA 自己的设置页里。 */}- <section- id="settings-bots"- className="py-[18px]"- aria-label={t('settings.sections.bots')}- >- <BotsGlobalSettingsSection />- </section>-{/* Section — App Behavior(「应用行为」)「保持电脑唤醒」跨平台生效,故 section 常驻;其中「后台窗口首次左键点击仅激活不透传」仅 mac/win 有效,由@@ -421,6 +394,16 @@ export function SettingsView() {<ComposerSendShortcutSection /></section>+ {/* Section — 伙伴(功能级设置:怎么提醒你 + 带走/接回一个伙伴)。+ 单个伙伴的性格、记忆、能力与日程仍在 TA 自己的设置页里。 */}+ <section+ id="settings-bots"+ className="py-[18px]"+ aria-label={t('settings.sections.bots')}+ >+ <BotsGlobalSettingsSection />+ </section>+{/* Section — Collaboration. */}<sectionid="settings-collaboration"@@ -444,6 +427,33 @@ export function SettingsView() {<GitSafetySection /></section>+ {/* Pi 扩展只在通用页提供一行入口,不占用设置一级菜单;与 Agent 相关设置放在一起。 */}+ <section id="settings-pi-extensions" className="py-[18px]" aria-label={t('settings.piPackages.title')}>+ <div className="flex flex-col gap-[14px]">+ <h2 className={SETTINGS_SECTION_TITLE_CLASS}>{t('settings.piPackages.title')}</h2>+ <div className={SETTINGS_CARD_CLASS}>+ <button+ type="button"+ onClick={handleOpenPiExtensions}+ className={cn(+ SETTINGS_ROW_CLASS,+ 'w-full rounded-xl text-left transition-colors hover:bg-[var(--settings-menu-bg-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--focus-ring)]',+ )}+ >+ <span className="flex min-w-0 flex-col gap-1">+ <span className={SETTINGS_ROW_LABEL_CLASS} style={{ letterSpacing: '0.12px' }}>+ {t('settings.piPackages.manageLabel')}+ </span>+ <span className={SETTINGS_ROW_HINT_CLASS}>+ {t('settings.piPackages.entryDescription')}+ </span>+ </span>+ <ChevronRight size={16} aria-hidden="true" className="shrink-0 text-[var(--text-tertiary)]" />+ </button>+ </div>+ </div>+ </section>+{/* Section — Experimental (py 18). */}<section id="settings-search-target-general-experimental" className="py-[18px]" aria-label={t('settings.sections.experimental')}><ExperimentalSection />@@ -481,6 +491,22 @@ export function SettingsView() {</div>)}+ {activeTab === 'appearance' && (+ <div+ role="tabpanel"+ id="settings-panel-appearance"+ aria-labelledby="settings-tab-appearance"+ >+ <section className="pb-[18px]" aria-label={t('settings.sections.appearance')}>+ <AppearanceSection />+ </section>+ {/* 流式输出淡入动效开关(默认开;reduced-motion 时无条件关);与外观各节同为 36px 节距 */}+ <section id="settings-search-target-appearance-stream-fade" className="pt-[18px] pb-[18px]" aria-label={t('settings.sections.streamFade')}>+ <StreamFadeSection />+ </section>+ </div>+ )}+{activeTab === 'personalization' && (<divrole="tabpanel"@@ -523,10 +549,6 @@ export function SettingsView() {<section id="settings-search-target-personalization-link-open" className="pb-[18px]" aria-label={t('settings.sections.linkOpen')}><LinkOpenSection /></section>- {/* 流式输出淡入动效开关(默认开;reduced-motion 时无条件关) */}- <section id="settings-search-target-personalization-stream-fade" className="pb-[18px]" aria-label={t('settings.sections.streamFade')}>- <StreamFadeSection />- </section>{/* "小技巧" section —— TipsSection 内部把多个功能性 cell(SilentEncryptedRetryCell / ChatEmbeddingCell) 装在一个共享灰底 container,形态跟 MemorySection 对齐 (单标题 + 多 cell + divider)。 */}diff --git a/apps/desktop/src/renderer/components/settings/StreamFadeSection.tsx b/apps/desktop/src/renderer/components/settings/StreamFadeSection.tsxindex 77cf9e1c51..88cbdc4a26 100644--- a/apps/desktop/src/renderer/components/settings/StreamFadeSection.tsx+++ b/apps/desktop/src/renderer/components/settings/StreamFadeSection.tsx@@ -1,5 +1,5 @@/**- * StreamFadeSection — Settings → 个性化 下的「流式动效」开关。+ * StreamFadeSection — Settings → 外观 下的「回复动效」开关。** 控制流式输出时正文的淡入浮现动效(词段 / inline code 原子 + 列表圆点同帧* 浮现,见 rehypeStreamWordFade):开(默认)= 新内容淡入;关 = 文字直接显示。@@ -23,13 +23,13 @@ export function StreamFadeSection() {return (<div className="flex flex-col gap-[14px]">- <h2 className="text-16 font-medium leading-[1.2] text-[var(--settings-section-title)]">+ <h3 className="text-16 font-medium leading-[1.2] text-[var(--settings-section-title)]">{t('settings.streamFade.title')}- </h2>+ </h3><divclassName={cn(- 'flex items-center justify-between gap-3 rounded-xl px-5 py-4',+ 'flex items-center justify-between gap-3 rounded-xl px-4 py-4','bg-[var(--settings-theme-card-bg)]','border border-[var(--settings-theme-card-border)]',)}diff --git a/apps/desktop/src/renderer/components/settings/WallpaperSection.tsx b/apps/desktop/src/renderer/components/settings/WallpaperSection.tsxindex 73796f0f4e..d24d750ea5 100644--- a/apps/desktop/src/renderer/components/settings/WallpaperSection.tsx+++ b/apps/desktop/src/renderer/components/settings/WallpaperSection.tsx@@ -19,6 +19,11 @@ import {SELECTABLE_WALLPAPER_IDS,type WallpaperId,} from '@/../shared/appearanceSettings';+import {+ SETTINGS_CARD_CLASS,+ SETTINGS_ROW_DIVIDER_CLASS,+ SETTINGS_SECTION_TITLE_CLASS,+} from './settingsRowClasses';export function WallpaperSection() {const { t } = useTranslation();@@ -97,26 +102,18 @@ export function WallpaperSection() {};return (- <div- id="settings-search-settings-appearance-wallpaper"- className={cn(- 'flex flex-col gap-4 rounded-xl border p-5',- 'border-[var(--settings-theme-card-border)] bg-[var(--settings-theme-card-bg)]',- )}+ <section+ id="settings-search-target-appearance-wallpaper"+ className="flex flex-col gap-[14px]"+ aria-label={t('settings.appearance.wallpaper.title')}>- <div className="flex items-start justify-between gap-3">- <div className="min-w-0">- <h3 className="text-13 font-medium text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.title')}- </h3>- <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.wallpaper.description')}- </p>- </div>+ <div className="flex min-h-[30px] items-center justify-between gap-3">+ <h3 className={SETTINGS_SECTION_TITLE_CLASS}>{t('settings.appearance.wallpaper.title')}</h3><Buttonvariant="secondary"- size="lg"- className="shrink-0 px-3"+ size="md"+ compact+ className="shrink-0"type="button"onClick={resetWallpaper}disabled={@@ -133,253 +130,265 @@ export function WallpaperSection() {</Button></div>- <div- className="grid grid-cols-[repeat(auto-fill,minmax(6rem,1fr))] gap-2"- role="radiogroup"- aria-label={t('settings.appearance.wallpaper.aria')}- onBlur={(event) => {- if (!event.currentTarget.contains(event.relatedTarget)) setFocusedWallpaperId(null);- }}- >- {SELECTABLE_WALLPAPER_IDS.map((id, index) => {- const selected = wallpaperId === id;- const label = t('settings.appearance.wallpaper.options.' + id);- const background =- id === 'custom' && customWallpaperUrl && !customVideo- ? `url("${customWallpaperUrl}")`- : getBuiltinWallpaperPreview(id);- return (- <Tip key={id} text={label}>- <button- ref={(button) => {- if (button) buttons.current.set(id, button);- else buttons.current.delete(id);- }}- type="button"- role="radio"- aria-checked={selected}- aria-label={label}- disabled={busy}- tabIndex={!busy && id === entryId ? 0 : -1}- onFocus={() => setFocusedWallpaperId(id)}- onKeyDown={(event) => {- if (busy || event.altKey || event.ctrlKey || event.metaKey) return;- const rtl = getComputedStyle(event.currentTarget).direction === 'rtl';- let next: number;- switch (event.key) {- case 'ArrowRight':- next = index + (rtl ? -1 : 1);- break;- case 'ArrowLeft':- next = index + (rtl ? 1 : -1);- break;- case 'ArrowDown':- next = index + 1;- break;- case 'ArrowUp':- next = index - 1;- break;- case 'Home':- next = 0;- break;- case 'End':- next = SELECTABLE_WALLPAPER_IDS.length - 1;- break;- default:- return;- }- event.preventDefault();- const count = SELECTABLE_WALLPAPER_IDS.length;- const target = SELECTABLE_WALLPAPER_IDS[(next + count) % count];- buttons.current.get(target)?.focus();- // An empty custom tile needs explicit activation to open the file picker.- if (target !== wallpaperId && (target !== 'custom' || customWallpaperUrl)) {- setWallpaper(target);- }- }}- onClick={() =>- id === 'custom' && !customWallpaperUrl ? void chooseWallpaper() : setWallpaper(id)- }- className={cn(- 'flex min-w-0 flex-col gap-1 rounded-xl text-left transition-colors',- 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--settings-theme-icon-active)]',- )}- >- <span- className={cn(- 'relative aspect-video w-full overflow-hidden rounded-xl border bg-[var(--settings-input-bg)]',- selected- ? 'border-2 border-[var(--settings-theme-preview-border-active)]'- : 'border-[var(--settings-theme-preview-border)]',- )}- style={{- backgroundImage: background,- backgroundPosition: 'center',- backgroundRepeat: 'no-repeat',- backgroundSize: 'cover',- }}- >- {id === 'custom' && customVideo ? (- <span className="absolute inset-0 flex items-center justify-center text-[var(--settings-section-sublabel)]">- <Film size={22} aria-hidden="true" />- </span>- ) : null}- {id === 'custom' && !customWallpaperUrl ? (- <span className="absolute inset-0 flex items-center justify-center text-[var(--settings-section-sublabel)]">- <ImagePlus size={22} aria-hidden="true" />+ <div id="settings-search-settings-appearance-wallpaper" className={SETTINGS_CARD_CLASS}>+ <div className="flex flex-col gap-4 px-4 py-4">+ <div+ className="grid grid-cols-[repeat(auto-fill,minmax(6rem,1fr))] gap-2"+ role="radiogroup"+ aria-label={t('settings.appearance.wallpaper.aria')}+ onBlur={(event) => {+ if (!event.currentTarget.contains(event.relatedTarget)) setFocusedWallpaperId(null);+ }}+ >+ {SELECTABLE_WALLPAPER_IDS.map((id, index) => {+ const selected = wallpaperId === id;+ const label = t('settings.appearance.wallpaper.options.' + id);+ const background =+ id === 'custom' && customWallpaperUrl && !customVideo+ ? `url("${customWallpaperUrl}")`+ : getBuiltinWallpaperPreview(id);+ return (+ <Tip key={id} text={label}>+ <button+ ref={(button) => {+ if (button) buttons.current.set(id, button);+ else buttons.current.delete(id);+ }}+ type="button"+ role="radio"+ aria-checked={selected}+ aria-label={label}+ disabled={busy}+ tabIndex={!busy && id === entryId ? 0 : -1}+ onFocus={() => setFocusedWallpaperId(id)}+ onKeyDown={(event) => {+ if (busy || event.altKey || event.ctrlKey || event.metaKey) return;+ const rtl = getComputedStyle(event.currentTarget).direction === 'rtl';+ let next: number;+ switch (event.key) {+ case 'ArrowRight':+ next = index + (rtl ? -1 : 1);+ break;+ case 'ArrowLeft':+ next = index + (rtl ? 1 : -1);+ break;+ case 'ArrowDown':+ next = index + 1;+ break;+ case 'ArrowUp':+ next = index - 1;+ break;+ case 'Home':+ next = 0;+ break;+ case 'End':+ next = SELECTABLE_WALLPAPER_IDS.length - 1;+ break;+ default:+ return;+ }+ event.preventDefault();+ const count = SELECTABLE_WALLPAPER_IDS.length;+ const target = SELECTABLE_WALLPAPER_IDS[(next + count) % count];+ buttons.current.get(target)?.focus();+ // An empty custom tile needs explicit activation to open the file picker.+ if (target !== wallpaperId && (target !== 'custom' || customWallpaperUrl)) {+ setWallpaper(target);+ }+ }}+ onClick={() =>+ id === 'custom' && !customWallpaperUrl+ ? void chooseWallpaper()+ : setWallpaper(id)+ }+ className={cn(+ 'flex min-w-0 flex-col gap-1 rounded-xl text-left transition-colors',+ 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--settings-theme-icon-active)]',+ )}+ >+ <span+ className={cn(+ 'relative aspect-video w-full overflow-hidden rounded-xl border bg-[var(--settings-input-bg)]',+ selected+ ? 'border-2 border-[var(--settings-theme-preview-border-active)]'+ : 'border-[var(--settings-theme-preview-border)]',+ )}+ style={{+ backgroundImage: background,+ backgroundPosition: 'center',+ backgroundRepeat: 'no-repeat',+ backgroundSize: 'cover',+ }}+ >+ {id === 'custom' && customVideo ? (+ <span className="absolute inset-0 flex items-center justify-center text-[var(--settings-section-sublabel)]">+ <Film size={22} aria-hidden="true" />+ </span>+ ) : null}+ {id === 'custom' && !customWallpaperUrl ? (+ <span className="absolute inset-0 flex items-center justify-center text-[var(--settings-section-sublabel)]">+ <ImagePlus size={22} aria-hidden="true" />+ </span>+ ) : null}+ {id === 'none' ? (+ <span className="absolute inset-0 flex items-center justify-center text-12 text-[var(--settings-section-sublabel)]">+ {t('settings.appearance.wallpaper.nonePreview')}+ </span>+ ) : null}</span>- ) : null}- {id === 'none' ? (- <span className="absolute inset-0 flex items-center justify-center text-12 text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.nonePreview')}+ <span+ className={cn(+ 'truncate text-12 font-medium',+ selected+ ? 'text-[var(--settings-theme-label-active)]'+ : 'text-[var(--settings-theme-label)]',+ )}+ >+ {label}</span>- ) : null}- </span>- <span- className={cn(- 'truncate text-12 font-medium',- selected- ? 'text-[var(--settings-theme-label-active)]'- : 'text-[var(--settings-theme-label)]',- )}- >- {label}- </span>- </button>- </Tip>- );- })}- </div>+ </button>+ </Tip>+ );+ })}+ </div>- {/* Only the selected wallpaper downloads; the grid stays available while it loads. */}- {downloading && (- <DownloadMeter- progress={{- label: t('settings.appearance.wallpaper.downloading'),- percent: downloadProgress * 100,- }}- />- )}- {retryable && (- <div role="status" className="flex items-center justify-between gap-3">- <p className="text-12 text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.downloadFailed')}- </p>- <Button variant="secondary" type="button" disabled={busy} onClick={retryDownload}>- <RotateCcw size={14} aria-hidden="true" />- {t('settings.appearance.wallpaper.retryDownload')}- </Button>- </div>- )}+ {/* Only the selected wallpaper downloads; the grid stays available while it loads. */}+ {downloading && (+ <DownloadMeter+ progress={{+ label: t('settings.appearance.wallpaper.downloading'),+ percent: downloadProgress * 100,+ }}+ />+ )}+ {retryable && (+ <div role="status" className="flex items-center justify-between gap-3">+ <p className="text-12 text-[var(--settings-section-sublabel)]">+ {t('settings.appearance.wallpaper.downloadFailed')}+ </p>+ <Button variant="secondary" type="button" disabled={busy} onClick={retryDownload}>+ <RotateCcw size={14} aria-hidden="true" />+ {t('settings.appearance.wallpaper.retryDownload')}+ </Button>+ </div>+ )}- <div className="flex flex-wrap items-center gap-3">- <Button- variant="secondary"- type="button"- disabled={busy}- onClick={() => void chooseWallpaper()}- >- <ImagePlus size={14} aria-hidden="true" />- {t(- `settings.appearance.wallpaper.${busy ? 'customBusy' : customWallpaperUrl ? 'customReplace' : 'customChoose'}`,+ <div className="flex flex-wrap items-center gap-3">+ <Button+ variant="secondary"+ type="button"+ disabled={busy}+ onClick={() => void chooseWallpaper()}+ >+ <ImagePlus size={14} aria-hidden="true" />+ {t(+ `settings.appearance.wallpaper.${busy ? 'customBusy' : customWallpaperUrl ? 'customReplace' : 'customChoose'}`,+ )}+ </Button>+ {customWallpaperUrl && (+ <Button+ variant="secondary"+ type="button"+ disabled={busy}+ onClick={() => void removeWallpaper()}+ >+ {t('settings.appearance.wallpaper.customRemove')}+ </Button>+ )}+ <p className="text-12 text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.wallpaper.customHint')}+ </p>+ </div>+ {(error || (wallpaperId === 'custom' && playbackFailed)) && (+ <ErrorNotice+ role="alert"+ message={error || t('settings.appearance.wallpaper.customPlaybackFailed')}+ />)}- </Button>- {customWallpaperUrl && (- <Button- variant="secondary"- type="button"- disabled={busy}- onClick={() => void removeWallpaper()}- >- {t('settings.appearance.wallpaper.customRemove')}- </Button>- )}- <p className="text-12 text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.customHint')}- </p>- </div>- {(error || (wallpaperId === 'custom' && playbackFailed)) && (- <ErrorNotice role="alert" message={error || t('settings.appearance.wallpaper.customPlaybackFailed')} />- )}+ </div>- <div className="h-px bg-[var(--settings-input-border)]" />+ <div className={SETTINGS_ROW_DIVIDER_CLASS} />- <div className="flex flex-col gap-3">- {(isSceneWallpaper(wallpaperId) || (wallpaperId === 'custom' && customVideo)) && (- <div className="flex items-center justify-between gap-3">- <div>- <p className="text-13 font-medium text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.motionLabel')}- </p>- <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">- {t('settings.appearance.wallpaper.motionHint')}- </p>+ <div className="flex flex-col gap-3 px-4 py-4">+ {(isSceneWallpaper(wallpaperId) || (wallpaperId === 'custom' && customVideo)) && (+ <div className="flex items-center justify-between gap-3">+ <div>+ <p className="text-13 font-medium text-[var(--settings-section-sublabel)]">+ {t('settings.appearance.wallpaper.motionLabel')}+ </p>+ <p className="mt-1 text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70">+ {t('settings.appearance.wallpaper.motionHint')}+ </p>+ </div>+ <SegmentedControl+ aria-label={t('settings.appearance.wallpaper.motionLabel')}+ value={wallpaperMotion}+ onValueChange={setMotion}+ options={[+ { value: 'static', label: t('settings.appearance.wallpaper.motionStatic') },+ { value: 'dynamic', label: t('settings.appearance.wallpaper.motionDynamic') },+ ]}+ /></div>- <SegmentedControl- aria-label={t('settings.appearance.wallpaper.motionLabel')}- value={wallpaperMotion}- onValueChange={setMotion}- options={[- { value: 'static', label: t('settings.appearance.wallpaper.motionStatic') },- { value: 'dynamic', label: t('settings.appearance.wallpaper.motionDynamic') },- ]}+ )}+ <div className="flex items-center gap-3">+ <span className="shrink-0 text-12 text-[var(--settings-section-sublabel)]">+ {t('settings.appearance.wallpaper.visibilityLabel')}+ </span>+ <Slider+ min={APPEARANCE_LIMITS.wallpaperVisibility.min}+ max={APPEARANCE_LIMITS.wallpaperVisibility.max}+ step={APPEARANCE_LIMITS.wallpaperVisibility.step}+ value={[visibility]}+ onValueChange={([value]) => {+ if (typeof value === 'number') setVisibility(value);+ }}+ aria-label={t('settings.appearance.wallpaper.visibilityLabel')}+ aria-describedby="wallpaper-visibility-hint"/>+ <span className="w-10 shrink-0 text-right font-mono text-12 text-[var(--settings-section-sublabel)]">+ {Math.round(visibility * 100)}%+ </span></div>- )}- <div className="flex items-center gap-3">- <span className="shrink-0 text-12 text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.visibilityLabel')}- </span>- <Slider- min={APPEARANCE_LIMITS.wallpaperVisibility.min}- max={APPEARANCE_LIMITS.wallpaperVisibility.max}- step={APPEARANCE_LIMITS.wallpaperVisibility.step}- value={[visibility]}- onValueChange={([value]) => {- if (typeof value === 'number') setVisibility(value);- }}- aria-label={t('settings.appearance.wallpaper.visibilityLabel')}- aria-describedby="wallpaper-visibility-hint"- />- <span className="w-10 shrink-0 text-right font-mono text-12 text-[var(--settings-section-sublabel)]">- {Math.round(visibility * 100)}%- </span>- </div>- <p- id="wallpaper-visibility-hint"- className="text-12 text-[var(--settings-section-sublabel)]"- >- {t('settings.appearance.wallpaper.visibilityHint')}- </p>- <div className="flex items-center gap-3">- <span className="shrink-0 text-12 text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.blurLabel')}- </span>- <Slider- min={APPEARANCE_LIMITS.wallpaperBlur.min}- max={APPEARANCE_LIMITS.wallpaperBlur.max}- step={APPEARANCE_LIMITS.wallpaperBlur.step}- value={[wallpaperBlur ?? 0]}- disabled={wallpaperId === 'none'}- onValueChange={([value]) => {- if (typeof value === 'number') previewBlur(value);- }}- onValueCommit={([value]) => {- if (typeof value === 'number') setBlur(value);- }}- onPointerCancel={cancelBlurPreview}- onLostPointerCapture={cancelBlurPreview}- aria-label={t('settings.appearance.wallpaper.blurLabel')}- aria-describedby="wallpaper-blur-hint"- />- <span className="w-10 shrink-0 text-right font-mono text-12 text-[var(--settings-section-sublabel)]">- {wallpaperBlur ?? 0}- </span>+ <p+ id="wallpaper-visibility-hint"+ className="text-12 text-[var(--settings-section-sublabel)] opacity-70"+ >+ {t('settings.appearance.wallpaper.visibilityHint')}+ </p>+ <div className="flex items-center gap-3">+ <span className="shrink-0 text-12 text-[var(--settings-section-sublabel)]">+ {t('settings.appearance.wallpaper.blurLabel')}+ </span>+ <Slider+ min={APPEARANCE_LIMITS.wallpaperBlur.min}+ max={APPEARANCE_LIMITS.wallpaperBlur.max}+ step={APPEARANCE_LIMITS.wallpaperBlur.step}+ value={[wallpaperBlur ?? 0]}+ disabled={wallpaperId === 'none'}+ onValueChange={([value]) => {+ if (typeof value === 'number') previewBlur(value);+ }}+ onValueCommit={([value]) => {+ if (typeof value === 'number') setBlur(value);+ }}+ onPointerCancel={cancelBlurPreview}+ onLostPointerCapture={cancelBlurPreview}+ aria-label={t('settings.appearance.wallpaper.blurLabel')}+ aria-describedby="wallpaper-blur-hint"+ />+ <span className="w-10 shrink-0 text-right font-mono text-12 text-[var(--settings-section-sublabel)]">+ {wallpaperBlur ?? 0}+ </span>+ </div>+ <p+ id="wallpaper-blur-hint"+ className="text-12 text-[var(--settings-section-sublabel)] opacity-70"+ >+ {t('settings.appearance.wallpaper.blurHint')}+ </p></div>- <p id="wallpaper-blur-hint" className="text-12 text-[var(--settings-section-sublabel)]">- {t('settings.appearance.wallpaper.blurHint')}- </p></div>- </div>+ </section>);}diff --git a/apps/desktop/src/renderer/components/settings/__tests__/AppearanceSection.accessibility.test.tsx b/apps/desktop/src/renderer/components/settings/__tests__/AppearanceSection.accessibility.test.tsxindex 308c292df6..0418e6c703 100644--- a/apps/desktop/src/renderer/components/settings/__tests__/AppearanceSection.accessibility.test.tsx+++ b/apps/desktop/src/renderer/components/settings/__tests__/AppearanceSection.accessibility.test.tsx@@ -6,6 +6,8 @@ import { describe, expect, it, vi } from 'vitest';import { AppearanceSection } from '../AppearanceSection';+const themeState = vi.hoisted(() => ({ familyId: 'cindy' }));+vi.mock('react-i18next', () => ({useTranslation: () => ({ t: (key: string) => key }),}));@@ -15,9 +17,8 @@ vi.mock('@/hooks/useTheme', () => ({useTheme: () => ({theme: 'system',setTheme: vi.fn(),- familyId: 'cindy',+ familyId: themeState.familyId,setFamily: vi.fn(),- fallbackFromType: null,}),}));@@ -158,4 +159,39 @@ describe('AppearanceSection accessibility', () => {screen.getByRole('spinbutton', { name: 'settings.appearance.font.codeSize.label' }),).toBeTruthy();});++ it('locks the appearance mode to the only variant of a single-variant theme', () => {+ themeState.familyId = 'eclipse';+ try {+ render(<AppearanceSection />);++ const modes = within(+ screen.getByRole('radiogroup', { name: 'settings.appearance.modeLabel' }),+ ).getAllByRole('radio');+ expect(modes.map((mode) => (mode as HTMLButtonElement).disabled)).toEqual([true, true, true]);+ expect(modes.map((mode) => mode.getAttribute('aria-checked'))).toEqual([+ 'false',+ 'true',+ 'false',+ ]);+ expect(screen.getByText('settings.appearance.singleVariant.darkNotice')).toBeTruthy();+ } finally {+ themeState.familyId = 'cindy';+ }+ });++ it('keeps the saved appearance mode selectable for two-variant themes', () => {+ render(<AppearanceSection />);++ const modes = within(+ screen.getByRole('radiogroup', { name: 'settings.appearance.modeLabel' }),+ ).getAllByRole('radio');+ expect(modes.some((mode) => (mode as HTMLButtonElement).disabled)).toBe(false);+ expect(modes.map((mode) => mode.getAttribute('aria-checked'))).toEqual([+ 'false',+ 'false',+ 'true',+ ]);+ expect(screen.queryByText(/settings\.appearance\.singleVariant\..*Notice/)).toBeNull();+ });});diff --git a/apps/desktop/src/renderer/components/settings/__tests__/settingsSearchCatalog.test.ts b/apps/desktop/src/renderer/components/settings/__tests__/settingsSearchCatalog.test.tsindex 9f39e2e22e..8eedc20f94 100644--- a/apps/desktop/src/renderer/components/settings/__tests__/settingsSearchCatalog.test.ts+++ b/apps/desktop/src/renderer/components/settings/__tests__/settingsSearchCatalog.test.ts@@ -4,6 +4,7 @@ import { TAB_IDS, TAB_LABEL_KEY } from '@/lib/tabLabels';import {buildSettingsSearchDocuments,+ isLegacyAppearanceDeepLink,normalizeSettingsSearchText,resolveSettingsSearchTarget,searchSettings,@@ -17,6 +18,7 @@ const translations: Record<string, string> = {'settings.sections.language': 'Language','settings.sections.user': 'User','settings.tabs.general': 'General',+ 'settings.tabs.appearance': 'Appearance','settings.tabs.personalization': 'Personalization','settings.wechatBot.title': '个人微信','settings.wecomBot.title': '企业微信智能机器人',@@ -35,15 +37,34 @@ describe('settings search catalog', () => {const documents = buildSettingsSearchDocuments(t, ['general']);expect(documents.every(({ entry }) => entry.tab === 'general')).toBe(true);- expect(documents.map(({ entry }) => entry.id)).toContain('general.appearance');+ expect(documents.map(({ entry }) => entry.id)).toContain('general.language');+ expect(documents.map(({ entry }) => entry.id)).not.toContain('appearance');expect(documents.map(({ entry }) => entry.id)).not.toContain('personalization.memory');});it('ranks exact section matches before broader category matches', () => {- const documents = buildSettingsSearchDocuments(t, ['general']);+ const documents = buildSettingsSearchDocuments(t, ['general', 'appearance']);const matches = searchSettings(documents, 'appearance');- expect(matches[0]?.entry.id).toBe('general.appearance');+ expect(matches[0]?.entry.id).toBe('appearance');+ });++ it('routes legacy appearance deep links to the Appearance tab', () => {+ expect(isLegacyAppearanceDeepLink(null, 'appearance')).toBe(true);+ expect(isLegacyAppearanceDeepLink('general', 'general.appearance')).toBe(true);+ expect(isLegacyAppearanceDeepLink(null, 'settings.appearance.modeLabel')).toBe(true);+ expect(isLegacyAppearanceDeepLink('personalization', 'streamFade')).toBe(true);+ expect(isLegacyAppearanceDeepLink('personalization', 'personalization.streamFade')).toBe(true);+ expect(resolveSettingsSearchTarget('appearance', 'streamFade')).toBe(+ 'settings-search-target-appearance-stream-fade',+ );+ });++ it('keeps sections that still live on General or Personalization in place', () => {+ expect(isLegacyAppearanceDeepLink(null, 'notifications')).toBe(false);+ expect(isLegacyAppearanceDeepLink('personalization', 'memory')).toBe(false);+ expect(isLegacyAppearanceDeepLink(null, null)).toBe(false);+ expect(isLegacyAppearanceDeepLink('remote-control', 'appearance')).toBe(false);});it('returns no results for an empty or unknown query', () => {diff --git a/apps/desktop/src/renderer/components/settings/settingsRowClasses.ts b/apps/desktop/src/renderer/components/settings/settingsRowClasses.tsnew file mode 100644index 0000000000..2154e7e289--- /dev/null+++ b/apps/desktop/src/renderer/components/settings/settingsRowClasses.ts@@ -0,0 +1,19 @@+import { cn } from '@/lib/utils';++/**+ * 设置页「标题在卡片外 + 一张卡片放多行 + 行间分割线」的共用样式。+ * 行:左侧名称与说明,右侧控件;控件放不下时用 `cindy-segmented-row` 让整组换行。+ */+export const SETTINGS_CARD_CLASS = cn(+ 'flex flex-col rounded-xl',+ 'bg-[var(--settings-theme-card-bg)]',+ 'border border-[var(--settings-theme-card-border)]',+);+export const SETTINGS_ROW_CLASS = 'flex items-center justify-between gap-3 px-4 py-4';+export const SETTINGS_ROW_LABEL_CLASS = 'text-13 font-medium text-[var(--settings-section-sublabel)]';+export const SETTINGS_ROW_HINT_CLASS =+ 'text-12 leading-[1.4] text-[var(--settings-section-sublabel)] opacity-70';+/** 行间分割线:左右缩进与行内边距对齐。 */+export const SETTINGS_ROW_DIVIDER_CLASS = 'mx-4 h-px bg-[var(--settings-theme-card-border)]';+export const SETTINGS_SECTION_TITLE_CLASS =+ 'text-16 font-medium leading-[1.2] text-[var(--settings-section-title)]';diff --git a/apps/desktop/src/renderer/components/settings/settingsSearchCatalog.ts b/apps/desktop/src/renderer/components/settings/settingsSearchCatalog.tsindex 3a1f0e7b31..dcadf205cc 100644--- a/apps/desktop/src/renderer/components/settings/settingsSearchCatalog.ts+++ b/apps/desktop/src/renderer/components/settings/settingsSearchCatalog.ts@@ -115,3 +115,17 @@ export function resolveSettingsSearchEntry(export function resolveSettingsSearchTarget(tab: SettingsTab, section: string | null): string | null {return resolveSettingsSearchEntry(tab, section)?.targetId ?? null;}++/**+ * 外观设置原在「通用」、回复动效原在「个性化」。拆出「外观」分区后,旧 section 深链+ * (如 ?section=appearance、?tab=personalization§ion=streamFade)在原分区已解析+ * 不到、但能在外观分区解析到时,应落到外观分区。+ */+export function isLegacyAppearanceDeepLink(rawTab: string | null, section: string | null): boolean {+ const legacyTab = rawTab ?? 'general';+ return (+ (legacyTab === 'general' || legacyTab === 'personalization') &&+ resolveSettingsSearchEntry(legacyTab, section) === null &&+ resolveSettingsSearchEntry('appearance', section) !== null+ );+}diff --git a/apps/desktop/src/renderer/i18n/locales/en/common.json b/apps/desktop/src/renderer/i18n/locales/en/common.jsonindex 9f63cc937e..6bbd516d55 100644--- a/apps/desktop/src/renderer/i18n/locales/en/common.json+++ b/apps/desktop/src/renderer/i18n/locales/en/common.json@@ -1293,6 +1293,7 @@"tabs": {"storage": "Storage","general": "General",+ "appearance": "Appearance","billing": "Usage and billing","usage": "Usage history","personalization": "Personalization",@@ -1619,6 +1620,7 @@"appearance": {"title": "Appearance","modeLabel": "Appearance Mode",+ "sidebarAndPanels": "Sidebar & panels","themeLabel": "Theme","themeAriaLabel": "Theme selection","localBadge": "(Local)",@@ -1645,6 +1647,7 @@},"font": {"reset": "Reset to default",+ "title": "Fonts","defaultPreset": "Default","presets": "Presets","custom": "Custom",@@ -1683,8 +1686,12 @@"ui": "The quick brown fox jumps over the lazy dog ABC xyz · a/b/c/d · a,b · 0123456789 !?@&"}},- "missingLightNotice": "{{name}} has no light variant; showing its dark variant instead.",- "missingDarkNotice": "{{name}} has no dark variant; showing its light variant instead.",+ "singleVariant": {+ "lightOnly": "Light only",+ "darkOnly": "Dark only",+ "lightNotice": "{{name}} only has a light variant, so the appearance mode stays light. Your choice comes back when you switch themes.",+ "darkNotice": "{{name}} only has a dark variant, so the appearance mode stays dark. Your choice comes back when you switch themes."+ },"theme": {"light": "Light","dark": "Dark",@@ -1777,7 +1784,7 @@"reset": "Restore default layout","resetSuccess": "Default panel layout restored","resetFailed": "Could not restore the panel layout.",- "saved": "Panel position saved. Restore the default layout in the Appearance section under Settings → General.",+ "saved": "Panel position saved. Restore the default layout in Settings → Appearance.","saveFailed": "Could not save panel positions."}},@@ -4585,7 +4592,7 @@"agentResource": {"saveFailed": "Failed to save. Try again.","title": "Agent Resource Usage",- "description": "Limit how much system capacity Agent command-line work can consume, so parallel tests or builds don't freeze your machine. Defaults to full speed (no intervention). The concurrency limit applies immediately; priority lowering reaches running Agent processes within about 15 seconds; raising priority back to Normal and toolchain thread caps only apply to newly started Agent processes. Applies to local Agents only; Agents on remote (SSH) machines are not governed by these settings.",+ "description": "Limit the system resources Agent command-line work can use, so parallel tests or builds don't slow down your computer. Defaults to full speed and applies only to local Agents, not remote (SSH) machines.","preset": "Profile","presets": {"full": "Full Speed",@@ -4601,18 +4608,19 @@"maxConcurrent": "Concurrent Command Limit","maxConcurrentHint": "Maximum number of commands the Claude Code engine may run at once; extra commands wait in a queue. 0 means unlimited. Codex commands run inside their own sandbox without a per-command hook and are covered by the priority and thread-cap layers instead.","priority": "Process Priority",- "priorityHint": "Lower it so Agents only use idle capacity and foreground apps stay responsive. Raising it back only applies to newly started Agent processes.",+ "priorityHint": "Lower it so Agents only use idle capacity and foreground apps stay responsive. Lowering reaches running Agents within about 15 seconds; raising it back to Normal only applies to newly started Agents.","priorityOptions": {"normal": "Normal","low": "Low","lowest": "Lowest"},"capThreads": "Cap Toolchain Parallelism",- "capThreadsHint": "Injects environment variables such as VITEST_MAX_FORKS and MAKEFLAGS so a single test or build command can't take every CPU core. Variables you set yourself are never overridden."+ "capThreadsHint": "Injects environment variables such as VITEST_MAX_FORKS and MAKEFLAGS so a single test or build command can't take every CPU core. Applies only to newly started Agents; variables you set yourself are never overridden."},"piPackages": {"title": "Pi extensions","entryTitle": "Pi extension settings",+ "manageLabel": "Manage extensions","entryDescription": "Install, enable, or uninstall extensions for Cindy's Pi","backToGeneral": "Back to General","description": "Extensions stay in Cindy on this device. Any ordinary Pi task executed here can use them, even when started from a phone or another connected client. Review does not load them.",@@ -9102,6 +9110,8 @@"globalSettings": {"restoreHint": "Restoring defaults follows the client’s default model settings. Individual teammates’ custom models stay unchanged.","restoreFailed": "Could not restore defaults. Try again.",+ "defaultModel": "Default model",+ "defaultModelHint": "Teammates use this model by default. Each teammate can pick a different one in their own settings.","title": "Teammates","description": "Settings shared by all teammates. Anything about one teammate lives on their own page.","rosterNote": "The shipped roster grows with each release."diff --git a/apps/desktop/src/renderer/i18n/locales/ja/common.json b/apps/desktop/src/renderer/i18n/locales/ja/common.jsonindex bcb7be84ac..1443334e63 100644--- a/apps/desktop/src/renderer/i18n/locales/ja/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ja/common.json@@ -1264,6 +1264,7 @@"tabs": {"storage": "ストレージ","general": "一般",+ "appearance": "外観","billing": "使用量と請求","usage": "使用履歴","personalization": "パーソナライズ",@@ -1590,6 +1591,7 @@"appearance": {"title": "外観","modeLabel": "表示モード",+ "sidebarAndPanels": "サイドバーとパネル","themeLabel": "テーマ","themeAriaLabel": "テーマの選択","localBadge": "(ローカル)",@@ -1616,6 +1618,7 @@},"font": {"reset": "デフォルトに戻す",+ "title": "フォント","defaultPreset": "デフォルト","presets": "プリセット","custom": "カスタム",@@ -1654,8 +1657,12 @@"ui": "日本語フォントは読みやすく美しい ABC xyz · a/b/c/d · a,b · 0123456789 !?@&"}},- "missingLightNotice": "{{name}} はライトバリアントを提供していないため、ダークバリアントを表示しています。",- "missingDarkNotice": "{{name}} はダークバリアントを提供していないため、ライトバリアントを表示しています。",+ "singleVariant": {+ "lightOnly": "ライトのみ",+ "darkOnly": "ダークのみ",+ "lightNotice": "{{name}} はライトバリアントのみのため、表示モードはライトに固定されます。ほかのテーマに切り替えると、選んだ設定に戻ります。",+ "darkNotice": "{{name}} はダークバリアントのみのため、表示モードはダークに固定されます。ほかのテーマに切り替えると、選んだ設定に戻ります。"+ },"theme": {"light": "ライト","dark": "ダーク",@@ -1748,7 +1755,7 @@"reset": "初期レイアウトに戻す","resetSuccess": "パネルレイアウトを初期状態に戻しました","resetFailed": "パネル配置を復元できませんでした。",- "saved": "パネル位置を保存しました。[設定 → 一般]の[外観]セクションで初期レイアウトに戻せます。",+ "saved": "パネル位置を保存しました。[設定 → 外観]で初期レイアウトに戻せます。","saveFailed": "パネルの位置を保存できませんでした。"}},@@ -4554,7 +4561,7 @@"agentResource": {"saveFailed": "保存に失敗しました。もう一度お試しください。","title": "Agent リソース使用量",- "description": "Agent のコマンドライン作業によるシステム負荷を制限し、並列テストやビルドでマシンが固まるのを防ぎます。デフォルトはフルスピード(制限なし)。同時実行上限は即時反映されます。優先度の引き下げは実行中の Agent プロセスにも約 15 秒以内に適用されます。優先度を標準へ戻す操作とツールチェーンのスレッド上限は、新しく起動した Agent プロセスにのみ適用されます。本設定はローカルの Agent にのみ適用され、リモート(SSH)マシン上の Agent には影響しません。",+ "description": "Agent のコマンドライン作業が使うシステムリソースを制限し、並列テストやビルドでパソコンが重くなるのを防ぎます。デフォルトはフルスピードで、ローカルの Agent にのみ適用され、リモート(SSH)マシンには影響しません。","preset": "プロファイル","presets": {"full": "フルスピード",@@ -4570,18 +4577,19 @@"maxConcurrent": "同時実行コマンド数の上限","maxConcurrentHint": "Claude Code エンジンが同時に実行できるコマンド数の上限です。超えた分はキューで待機します。0 は無制限です。Codex のコマンドは自身のサンドボックス内で実行されるためこの上限の対象外で、優先度とスレッド上限でカバーされます。","priority": "プロセス優先度",- "priorityHint": "下げると Agent はアイドルリソースのみを使い、前面のアプリが優先されます。上げ直した場合は新しく起動した Agent プロセスにのみ適用されます。",+ "priorityHint": "下げると Agent はアイドルリソースのみを使い、前面のアプリが優先されます。引き下げは実行中の Agent にも約 15 秒以内に適用され、標準へ戻した場合は新しく起動した Agent にのみ適用されます。","priorityOptions": {"normal": "標準","low": "低","lowest": "最低"},"capThreads": "ツールチェーンの並列度を制限",- "capThreadsHint": "VITEST_MAX_FORKS や MAKEFLAGS などの環境変数を注入し、1 つのテストやビルドが全 CPU コアを占有しないようにします。自分で設定した同名の変数は上書きされません。"+ "capThreadsHint": "VITEST_MAX_FORKS や MAKEFLAGS などの環境変数を注入し、1 つのテストやビルドが全 CPU コアを占有しないようにします。新しく起動した Agent にのみ適用され、自分で設定した同名の変数は上書きされません。"},"piPackages": {"title": "Pi 拡張機能","entryTitle": "Pi 拡張機能の設定",+ "manageLabel": "拡張機能を管理","entryDescription": "Cindy の Pi 拡張機能をインストール、有効化、アンインストール","backToGeneral": "一般に戻る","description": "拡張機能はこのデバイスの Cindy にインストールされます。このデバイス上の通常 Pi で実行されるタスクなら、端末本体、スマートフォン、ほかの接続済みクライアントのどこから開始しても利用できます。Review では読み込みません。",@@ -9063,6 +9071,8 @@"globalSettings": {"restoreHint": "復元後はクライアントの既定のモデル設定に従います。各パートナーのカスタムモデルは変更されません。","restoreFailed": "既定値を復元できませんでした。もう一度お試しください。",+ "defaultModel": "デフォルトのモデル",+ "defaultModelHint": "パートナーが標準で使うモデルです。個々のパートナーは自分の設定で別のモデルを選べます。","title": "パートナー","description": "パートナー全体に共通する設定です。個々のパートナーの設定は、その子のページにあります。","rosterNote": "あらかじめ用意された顔ぶれは、バージョンごとに増えていきます。"diff --git a/apps/desktop/src/renderer/i18n/locales/ko/common.json b/apps/desktop/src/renderer/i18n/locales/ko/common.jsonindex b810af0d08..d735eb1c8d 100644--- a/apps/desktop/src/renderer/i18n/locales/ko/common.json+++ b/apps/desktop/src/renderer/i18n/locales/ko/common.json@@ -1264,6 +1264,7 @@"tabs": {"storage": "저장 공간","general": "일반",+ "appearance": "외관","billing": "사용량 및 결제","usage": "사용 기록","personalization": "개인화",@@ -1590,6 +1591,7 @@"appearance": {"title": "외관","modeLabel": "표시 모드",+ "sidebarAndPanels": "사이드바 및 패널","themeLabel": "테마","themeAriaLabel": "테마 선택","localBadge": "(로컬)",@@ -1616,6 +1618,7 @@},"font": {"reset": "기본값으로 재설정",+ "title": "글꼴","defaultPreset": "기본값","presets": "프리셋","custom": "사용자 지정",@@ -1654,8 +1657,12 @@"ui": "한글 글꼴은 또렷하고 읽기 쉬워요 ABC xyz · a/b/c/d · a,b · 0123456789 !?@&"}},- "missingLightNotice": "{{name}} 테마는 라이트 변형을 제공하지 않아 다크 변형을 표시했습니다.",- "missingDarkNotice": "{{name}} 테마는 다크 변형을 제공하지 않아 라이트 변형을 표시했습니다.",+ "singleVariant": {+ "lightOnly": "라이트 전용",+ "darkOnly": "다크 전용",+ "lightNotice": "{{name}} 테마는 라이트 변형만 있어 표시 모드가 라이트로 고정됩니다. 다른 테마로 바꾸면 선택한 설정으로 돌아갑니다.",+ "darkNotice": "{{name}} 테마는 다크 변형만 있어 표시 모드가 다크로 고정됩니다. 다른 테마로 바꾸면 선택한 설정으로 돌아갑니다."+ },"theme": {"light": "라이트","dark": "다크",@@ -1748,7 +1755,7 @@"reset": "기본 레이아웃 복원","resetSuccess": "기본 패널 레이아웃을 복원했습니다","resetFailed": "패널 배치를 복원하지 못했습니다.",- "saved": "패널 위치를 저장했습니다. 설정 → 일반의 모양 섹션에서 기본 레이아웃으로 복원할 수 있습니다.",+ "saved": "패널 위치를 저장했습니다. 설정 → 외관에서 기본 레이아웃으로 복원할 수 있습니다.","saveFailed": "패널 위치를 저장하지 못했습니다."}},@@ -4554,7 +4561,7 @@"agentResource": {"saveFailed": "저장하지 못했습니다. 다시 시도해 주세요.","title": "Agent 리소스 사용량",- "description": "Agent의 명령줄 작업이 시스템 자원을 과도하게 사용하지 않도록 제한하여, 병렬 테스트나 빌드로 컴퓨터가 느려지는 것을 방지합니다. 기본값은 전속력(제한 없음)입니다. 동시 실행 상한은 즉시 적용됩니다. 우선순위 낮추기는 실행 중인 Agent 프로세스에도 약 15초 이내에 적용됩니다. 우선순위를 보통으로 되돌리는 것과 툴체인 스레드 상한은 새로 시작된 Agent 프로세스에만 적용됩니다. 이 설정은 로컬 Agent에만 적용되며, 원격(SSH) 컴퓨터의 Agent에는 적용되지 않습니다.",+ "description": "Agent의 명령줄 작업이 사용하는 시스템 자원을 제한하여 병렬 테스트나 빌드로 컴퓨터가 느려지는 것을 방지합니다. 기본값은 전속력이며, 로컬 Agent에만 적용되고 원격(SSH) 컴퓨터에는 영향을 주지 않습니다.","preset": "프로필","presets": {"full": "전속력",@@ -4570,18 +4577,19 @@"maxConcurrent": "동시 실행 명령 상한","maxConcurrentHint": "Claude Code 엔진이 동시에 실행할 수 있는 명령 수의 상한이며, 초과분은 대기열에서 기다립니다. 0은 무제한입니다. Codex 명령은 자체 샌드박스에서 실행되어 이 상한의 적용을 받지 않으며, 우선순위와 스레드 상한으로 보완됩니다.","priority": "프로세스 우선순위",- "priorityHint": "낮추면 Agent는 유휴 자원만 사용하고 전면 앱이 우선됩니다. 다시 높이면 새로 시작된 Agent 프로세스에만 적용됩니다.",+ "priorityHint": "낮추면 Agent는 유휴 자원만 사용하고 전면 앱이 우선됩니다. 낮추기는 실행 중인 Agent에도 약 15초 이내에 적용되며, 보통으로 되돌리면 새로 시작된 Agent에만 적용됩니다.","priorityOptions": {"normal": "보통","low": "낮음","lowest": "최저"},"capThreads": "툴체인 병렬 처리 제한",- "capThreadsHint": "VITEST_MAX_FORKS, MAKEFLAGS 등의 환경 변수를 주입하여 단일 테스트나 빌드 명령이 모든 CPU 코어를 점유하지 않도록 합니다. 직접 설정한 동일한 변수는 덮어쓰지 않습니다."+ "capThreadsHint": "VITEST_MAX_FORKS, MAKEFLAGS 등의 환경 변수를 주입하여 단일 테스트나 빌드 명령이 모든 CPU 코어를 점유하지 않도록 합니다. 새로 시작된 Agent에만 적용되며, 직접 설정한 동일한 변수는 덮어쓰지 않습니다."},"piPackages": {"title": "Pi 확장","entryTitle": "Pi 확장 설정",+ "manageLabel": "확장 관리","entryDescription": "Cindy의 Pi 확장을 설치, 활성화 또는 제거","backToGeneral": "일반으로 돌아가기","description": "확장은 이 기기의 Cindy에 설치됩니다. 이 기기의 일반 Pi에서 실행되는 작업이라면 기기 자체, 휴대전화 또는 다른 연결된 클라이언트 어디에서 시작해도 사용할 수 있습니다. Review에서는 불러오지 않습니다.",@@ -9063,6 +9071,8 @@"globalSettings": {"restoreHint": "기본값으로 복원하면 클라이언트의 기본 모델 설정을 따릅니다. 개별 파트너의 사용자 지정 모델은 유지됩니다.","restoreFailed": "기본값을 복원하지 못했습니다. 다시 시도해 주세요.",+ "defaultModel": "기본 사용 모델",+ "defaultModelHint": "파트너가 기본으로 사용하는 모델입니다. 개별 파트너는 각자의 설정에서 다른 모델을 선택할 수 있어요.","title": "파트너","description": "파트너 전체에 적용되는 설정입니다. 개별 파트너 설정은 각자의 페이지에 있어요.","rosterNote": "기본 제공되는 구성원은 버전마다 늘어납니다."diff --git a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.jsonindex c049583ddd..47a44ee35a 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-CN/common.json@@ -1264,6 +1264,7 @@"tabs": {"storage": "存储空间","general": "通用",+ "appearance": "外观","billing": "用量和计费","usage": "用量历史","personalization": "个性化",@@ -1590,6 +1591,7 @@"appearance": {"title": "外观","modeLabel": "显示模式",+ "sidebarAndPanels": "侧边栏与面板","themeLabel": "主题","themeAriaLabel": "主题选择","localBadge": "(本地)",@@ -1616,6 +1618,7 @@},"font": {"reset": "恢复默认",+ "title": "字体","defaultPreset": "默认","presets": "预设","custom": "自定义",@@ -1654,8 +1657,12 @@"ui": "中文字体预览,清晰锐利 ABC xyz · a/b/c/d · a,b · 0123456789 !?@&"}},- "missingLightNotice": "{{name}} 主题没有提供浅色方案,已显示其深色方案。",- "missingDarkNotice": "{{name}} 主题没有提供深色方案,已显示其浅色方案。",+ "singleVariant": {+ "lightOnly": "仅浅色",+ "darkOnly": "仅深色",+ "lightNotice": "{{name}} 只有浅色方案,显示模式固定为浅色;换成其他主题后恢复你的选择。",+ "darkNotice": "{{name}} 只有深色方案,显示模式固定为深色;换成其他主题后恢复你的选择。"+ },"theme": {"light": "浅色","dark": "深色",@@ -1748,7 +1755,7 @@"reset": "恢复默认布局","resetSuccess": "已恢复默认面板布局","resetFailed": "未能恢复面板布局",- "saved": "面板位置已保存;可在“设置 → 通用”的“外观”区域恢复默认布局",+ "saved": "面板位置已保存;可在“设置 → 外观”恢复默认布局","saveFailed": "未能保存面板位置"}},@@ -4554,7 +4561,7 @@"agentResource": {"saveFailed": "保存失败,请重试。","title": "Agent 资源占用",- "description": "限制 Agent 命令行任务的系统资源占用,避免并行测试、构建把机器拖卡。默认全速(不干预)。并发上限即刻生效;优先级降档对已在跑的 Agent 进程约 15 秒内生效;把优先级调回正常和工具链限核只对新启动的 Agent 进程生效。仅作用于本机 Agent;远端(SSH)机器上的 Agent 不受本设置约束。",+ "description": "限制 Agent 命令行任务占用的系统资源,避免并行测试或构建拖慢电脑。默认全速,只作用于本机 Agent,不影响远端(SSH)机器。","preset": "档位","presets": {"full": "全速",@@ -4570,18 +4577,19 @@"maxConcurrent": "并发命令上限","maxConcurrentHint": "Claude Code 引擎所有命令的并发上限,超出的排队等待;0 表示不限。Codex 命令在自身沙箱内执行、不经此闸门,由优先级与限核层覆盖。","priority": "进程优先级",- "priorityHint": "调低后 Agent 只用空闲资源,前台应用优先。从低档调回后只对新启动的 Agent 进程生效。",+ "priorityHint": "调低后 Agent 只用空闲资源,前台应用优先;约 15 秒内对运行中的 Agent 生效,调回正常只对新启动的 Agent 生效。","priorityOptions": {"normal": "正常","low": "低","lowest": "最低"},"capThreads": "限制工具链并行度",- "capThreadsHint": "注入 VITEST_MAX_FORKS、MAKEFLAGS 等环境变量,防止单条测试或构建命令占满全部 CPU 核心;你自己设置过的同名变量不会被覆盖。"+ "capThreadsHint": "注入 VITEST_MAX_FORKS、MAKEFLAGS 等环境变量,防止单条测试或构建命令占满全部 CPU 核心;只对新启动的 Agent 生效,你自己设置过的同名变量不会被覆盖。"},"piPackages": {"title": "Pi 扩展","entryTitle": "Pi 扩展设置",+ "manageLabel": "管理扩展","entryDescription": "安装、启用或卸载 Cindy 的 Pi 扩展","backToGeneral": "返回通用","description": "扩展只安装并运行在这台设备的 Cindy 中,不会传到手机或其他设备。无论任务从哪里发起,只要由这台设备的普通 Pi 执行都会生效;Review 不加载。",@@ -9063,6 +9071,8 @@"globalSettings": {"restoreHint": "恢复默认后将跟随客户端默认模型设置,单个伙伴的自定义模型保持不变。","restoreFailed": "恢复默认失败,请重试。",+ "defaultModel": "默认模型",+ "defaultModelHint": "伙伴默认使用的模型,单个伙伴可以在自己的设置里另选。","title": "伙伴","description": "和伙伴有关的通用设置。单个伙伴的设置在{{pronoun}}自己的页面里。","rosterNote": "预置阵容会随版本更新。"diff --git a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.jsonindex d7c89f329b..03a61e6696 100644--- a/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json+++ b/apps/desktop/src/renderer/i18n/locales/zh-TW/common.json@@ -1264,6 +1264,7 @@"tabs": {"storage": "儲存空間","general": "通用",+ "appearance": "外觀","billing": "用量和計費","usage": "用量歷史","personalization": "個性化",@@ -1590,6 +1591,7 @@"appearance": {"title": "外觀","modeLabel": "顯示模式",+ "sidebarAndPanels": "側邊欄與面板","themeLabel": "主題","themeAriaLabel": "主題選擇","localBadge": "(本地)",@@ -1616,6 +1618,7 @@},"font": {"reset": "恢復預設",+ "title": "字體","defaultPreset": "預設","presets": "預設","custom": "自定義",@@ -1654,8 +1657,12 @@"ui": "中文字型預覽,清晰銳利 ABC xyz · a/b/c/d · a,b · 0123456789 !?@&"}},- "missingLightNotice": "{{name}} 主題沒有提供淺色方案,已顯示其深色方案。",- "missingDarkNotice": "{{name}} 主題沒有提供深色方案,已顯示其淺色方案。",+ "singleVariant": {+ "lightOnly": "僅淺色",+ "darkOnly": "僅深色",+ "lightNotice": "{{name}} 只有淺色方案,顯示模式固定為淺色;換成其他主題後恢復你的選擇。",+ "darkNotice": "{{name}} 只有深色方案,顯示模式固定為深色;換成其他主題後恢復你的選擇。"+ },"theme": {"light": "淺色","dark": "深色",@@ -1748,7 +1755,7 @@"reset": "恢復預設佈局","resetSuccess": "已恢復預設面板佈局","resetFailed": "無法恢復面板配置",- "saved": "面板位置已儲存;可在「設定 → 一般」的「外觀」區段恢復預設配置",+ "saved": "面板位置已儲存;可在「設定 → 外觀」恢復預設配置","saveFailed": "無法儲存面板位置"}},@@ -4554,7 +4561,7 @@"agentResource": {"saveFailed": "儲存失敗,請重試。","title": "Agent 資源佔用",- "description": "限制 Agent 命令列任務的系統資源佔用,避免並行測試、構建把機器拖卡。預設全速(不干預)。併發上限即刻生效;優先順序降檔對已在跑的 Agent 處理程序約 15 秒內生效;把優先順序調回正常和工具鏈限核只對新啟動的 Agent 處理程序生效。僅作用於本機 Agent;遠端(SSH)機器上的 Agent 不受本設定約束。",+ "description": "限制 Agent 命令列任務佔用的系統資源,避免並行測試或構建拖慢電腦。預設全速,只作用於本機 Agent,不影響遠端(SSH)機器。","preset": "檔位","presets": {"full": "全速",@@ -4570,18 +4577,19 @@"maxConcurrent": "併發命令上限","maxConcurrentHint": "Claude Code 引擎所有命令的併發上限,超出的排隊等待;0 表示不限。Codex 命令在自身沙箱內執行、不經此閘門,由優先順序與限核層覆蓋。","priority": "程序優先順序",- "priorityHint": "調低後 Agent 只用空閒資源,前臺應用優先。從低檔調回後只對新啟動的 Agent 程序生效。",+ "priorityHint": "調低後 Agent 只用空閒資源,前臺應用優先;約 15 秒內對執行中的 Agent 生效,調回正常只對新啟動的 Agent 生效。","priorityOptions": {"normal": "正常","low": "低","lowest": "最低"},"capThreads": "限制工具鏈並行度",- "capThreadsHint": "注入 VITEST_MAX_FORKS、MAKEFLAGS 等環境變數,防止單條測試或構建命令佔滿全部 CPU 核心;你自己設定過的同名變數不會被覆蓋。"+ "capThreadsHint": "注入 VITEST_MAX_FORKS、MAKEFLAGS 等環境變數,防止單條測試或構建命令佔滿全部 CPU 核心;只對新啟動的 Agent 生效,你自己設定過的同名變數不會被覆蓋。"},"piPackages": {"title": "Pi 擴充功能","entryTitle": "Pi 擴充功能設定",+ "manageLabel": "管理擴充功能","entryDescription": "安裝、啟用或解除安裝 Cindy 的 Pi 擴充功能","backToGeneral": "返回一般","description": "擴充功能安裝在這台裝置的 Cindy 中。無論任務由本機、手機或其他已連線用戶端發起,只要由這台裝置的普通 Pi 執行都會生效;Review 不載入。",@@ -9063,6 +9071,8 @@"globalSettings": {"restoreHint": "恢復預設後將跟隨用戶端預設模型設定,個別夥伴的自訂模型保持不變。","restoreFailed": "恢復預設失敗,請重試。",+ "defaultModel": "預設模型",+ "defaultModelHint": "夥伴預設使用的模型,單個夥伴可以在自己的設定裡另選。","title": "伙伴","description": "和伙伴有關的通用設定。單個伙伴的設定在{{pronoun}}自己的頁面裡。","rosterNote": "預置陣容會隨版本更新。"diff --git a/apps/desktop/src/renderer/lib/tabLabels.ts b/apps/desktop/src/renderer/lib/tabLabels.tsindex d26e6031eb..2e6a22319d 100644--- a/apps/desktop/src/renderer/lib/tabLabels.ts+++ b/apps/desktop/src/renderer/lib/tabLabels.ts@@ -9,6 +9,7 @@export type SettingsTab =| 'general'+ | 'appearance'| 'billing'| 'usage'| 'personalization'@@ -34,6 +35,9 @@ export type SettingsTab =export const TAB_IDS = ['general',+ // 「外观」从通用页拆出的独立分区:主题、壁纸、字体、侧边栏样式与回复动效。+ // 旧「通用」「个性化」里的外观深链由 SettingsView 重定向到这里。+ 'appearance','personalization','providers','billing',@@ -66,6 +70,7 @@ export type VisibleSettingsTab = (typeof TAB_IDS)[number];export const TAB_LABEL_KEY: Record<SettingsTab, string> = {general: 'settings.tabs.general',+ appearance: 'settings.tabs.appearance',billing: 'settings.tabs.billing',usage: 'settings.tabs.usage',personalization: 'settings.tabs.personalization',diff --git a/apps/desktop/src/shared/helpTypes.ts b/apps/desktop/src/shared/helpTypes.tsindex a96984f54f..92cf3cdf02 100644--- a/apps/desktop/src/shared/helpTypes.ts+++ b/apps/desktop/src/shared/helpTypes.ts@@ -17,6 +17,7 @@ export type HelpRole = 'user' | 'assistant';* dependency. main validates LLM-emitted tab ids against this same set. */export type HelpTabId =| 'general'+ | 'appearance'| 'personalization'| 'api-keys'| 'providers'diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex 54cc432f2d..3764445a5f 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -452,6 +452,10 @@ card/containerhover --surface-hover #e5e5e5 / #3c3c3a```+### Desktop settings rows++Desktop Settings sections put the 16px/500 section title outside the card. A card groups related settings as rows: label (13px/500) and hint (12px) on the left, the control on the right, `px-4 py-4` per row, and an inset divider between visible rows only. Related switches share one card instead of one card each; a row that opens a sub-page uses the same row with a trailing chevron. Use the shared classes in [settingsRowClasses.ts](../../apps/desktop/src/renderer/components/settings/settingsRowClasses.ts). Settings → General follows this throughout (owner request, 2026-10-17); other Settings pages still contain 20px single-row cards and are not declared migrated.+### Provider detail headerAll provider connections share one header pattern, independent of builtin/custom storage or login source.@@ -864,6 +868,8 @@ Source: `apps/desktop/src/renderer/themes/`Theme switching: `useTheme.ts` provides `theme` (System / Light / Dark mode) plus `lightThemeId` / `darkThemeId` (which concrete theme). Settings → Appearance is the UI entry.+Settings → Appearance opens with a 20px/500 page title (line height 1.3, 24px above the first section), one step above the 16px section titles. The theme card follows the page title directly, without its own section title; Wallpaper, Fonts, Sidebar & panels and Reply Animation follow, each titled outside its card and laid out as settings rows (see “Desktop settings rows”). In the theme card, Theme, Appearance mode and Local themes are separate rows divided by lines. Theme is a single row whose picker is the same 320×36 pill select as Settings → General → Display language (same trigger, popover, option and selected styles). Theme, Local themes and Wallpaper carry no extra description line. Wide controls (wallpaper grid, sliders, and the font pickers, whose preview popovers must match the trigger width) sit under their row label. The appearance mode is one row: label on the left, three 92×60 window thumbnails on the right with a 12px caption. Each thumbnail draws a miniature Cindy window (sidebar, user message, reply lines, composer with send dot) from the selected color theme’s own `surface`, `surface-chip`, `border-default`, `surface-elevated`, `text-primary` and `text-tertiary` values; “System” shows the light half on the left and the dark half on the right. The selected thumbnail gets a 2px `--settings-theme-preview-border-active` ring with a 2px gap (12px outer / 8px inner radius), unselected ones show the ordinary preview border on hover. The theme picker comes before the appearance mode. A theme family with only one variant is tagged “Light only” / “Dark only” in the theme list. While such a theme is selected, the three mode cards are disabled and show the variant actually rendered, with one line under the mode label explaining it; the saved mode is not changed and applies again when a two-variant theme is chosen (owner request, 2026-10-17). Implementation: [AppearanceSection.tsx](../../apps/desktop/src/renderer/components/settings/AppearanceSection.tsx); regressions in `AppearanceSection.accessibility.test.tsx`.+### Token Tiers**Tier 1 — Semantic slots**: the core cross-context slots; when adding a theme, this tier is the main override battleground. The exact-value summary below is generated from the Desktop DTCG source. Registry IDs and usages remain the compatibility contract.diff --git a/docs/design-rules/design-decision-log.md b/docs/design-rules/design-decision-log.mdindex 609a3fe485..a0e8fed3c1 100644--- a/docs/design-rules/design-decision-log.md+++ b/docs/design-rules/design-decision-log.md@@ -24,6 +24,16 @@- **10-18 错误提示统一为中性卡片,历史恢复沿用 Fork 图标**——用户认为原有大面积红底错误提示难看,且「可读历史」「内部加密信息」等文案难懂,要求统一错误提示。错误卡片使用中性底色、细边框、小红色图标和清晰操作,技术详情默认折叠;历史恢复改为「在新任务中继续」。用户特别澄清,图标应与消息 Fork「开启一个新任务」入口一致,使用 `Split`。桌面与移动端分别复用 `ErrorNotice`。示意图用于确认方向,不代表实机视觉验收。+- **10-18 「主题」改为单行下拉,与显示模式之间恢复分割线**——用户要求主题选择做成一行,并指定用「通用 → 显示语言」同款的胶囊下拉。现行:「主题」左侧名称、右侧 320×36 胶囊下拉,触发器、展开面板、选项与选中样式与「显示语言」同一实现(Radix Select),单方案主题的「仅浅色 / 仅深色」标记保留在当前值与选项上;「主题」「显示模式」「本地主题」三行之间都用分割线隔开。被取代:同日的整行宽下拉与「主题、显示模式之间不加分割线」。落点:DESIGN.md Theme switching 段;`AppearanceSection.tsx` `FamilyDropdown`。验证为开发版实测(两只下拉同为 320×36)与截图。++- **10-18 外观页首卡去掉节标题**——用户裁决:页面标题「外观」下直接接主题卡片,不再另设「主题」节标题;卡片内下拉框名称由「配色」改回「主题」并去掉说明小字;「主题」与「显示模式」之间不加分割线(两者是一组:主题决定可用模式),「本地主题」前保留分割线。被取代:同日早些时候的「主题」节标题与「配色」命名。落点:DESIGN.md Theme switching 段。++- **10-18 「外观」恢复页面标题,显示模式改为窗口缩略图**——用户更正:左侧菜单的「外观」与页内「外观」是两层,页内的是整页标题,应保留,并问是否该更大。现行:页内标题 20px / 500、行高 1.3,下距首节 24px,比各节标题 16px 高一级(取桌面标题段白名单的下一档);「配色」名称保留。显示模式按用户给的参考图改为一行:左侧名称,右侧三张 92×60 的迷你 Cindy 窗口缩略图(侧栏、右上用户消息、几行回复、底部输入框与发送键)加 12px 说明,颜色直接取所选配色的浅 / 深方案,「跟随系统」左浅右深;选中项外圈 2px 描边加 2px 间隙,未选中悬停显出普通描边。缩略图不用品牌红(品牌红只用于品牌画布)。同日用户要求去掉「本地主题」与「壁纸」下方的小字说明。被取代:三张大图标卡片(太阳 / 月亮 / 显示器)与当日早些时候「页内不重复页名」的做法。落点:DESIGN.md Theme switching 段;测试:`AppearanceSection.accessibility.test.tsx`。验证为开发版实机截图(浅 / 深色、Eclipse 仅深色、Solarized 仅浅色)。++- **10-18 「外观」栏目内重排信息层级**——用户指出「外观」已是独立栏目,页内不应再以「外观」为标题,各栏目也应重新梳理层级与标题。现行:去掉页内「外观」大标题,分为主题、壁纸、字体、侧边栏与面板、回复动效五节,标题在卡片外,卡片内按设置行排并以分割线隔开;主题节内的下拉框改名「配色」以免与节标题重复,「本地主题」补一句说明并把四个按钮移到行右侧;壁纸的「恢复默认」移到节标题右侧,原卡片内小标题与说明改为节标题与节说明;「面板布局」并入侧边栏与面板卡片;字号的恢复默认按钮改用与其他恢复默认一致的回退图标;设置搜索为「字体」「侧边栏与面板」两节补入口。字体与配色下拉框保持整行宽度,因为展开面板须与触发器同宽,压窄会挤坏字体预览与自定义输入。同日用户裁决:设置页下拉框的当前值与选项统一为常规字重 400,选中项只靠勾与底色表示;壁纸滑块名称保持 12px。被取代:页内「外观」大标题与单卡堆叠。落点:DESIGN.md Theme switching 段与「Desktop settings rows」;测试:`settingsSearchCatalog.test.ts`、`AppearanceSection.accessibility.test.tsx`。验证为开发版实机截图与逐元素字号字重测量。++- **10-17 桌面设置拆出「外观」栏目,「通用」页重排;单方案主题锁定显示模式**——用户认为外观相关设置值得单列,并要求桌面端先拆。现行:设置左侧菜单「通用」下新增「外观」,收纳主题与显示模式、本地主题、壁纸、字体与字号、侧边栏样式、插件面板恢复入口、面板布局,以及原在「个性化」的「回复动效」;旧的「通用 → 外观」「个性化 → 回复动效」链接与搜索结果自动落到新栏目,帮助助手知识拆为「外观」和「语言与通知」两篇。「通用」按常用程度重排为:账号、语言、通知、应用行为、消息输入、伙伴、协同、Agent 资源占用、Git 安全、Pi 扩展、实验性功能;「消息输入」按用户裁决不挪到「键盘快捷键」。排版统一为「标题在卡片外、同类设置同卡多行、行间分割线」:应用行为与实验性功能各合成一张卡,消息输入改为与其他行一致的字号字色,Pi 扩展补标题并改为带箭头的标准行,伙伴的默认模型改为「左名称说明、右选择器」,备用模型单列一行并带添加按钮;Agent 资源占用的长说明经用户同意精简为一句,生效时机挪到各行说明。用户同时指出部分主题没有浅色或深色方案:主题改排在显示模式之前,主题列表给单方案主题标「仅浅色 / 仅深色」,选中时显示模式只读并说明原因,保存的模式不变。被取代:外观作为「通用」中的一节、单方案主题仅在卡片底部给一行提示。落点:DESIGN.md「Desktop settings rows」与 Theme switching 段;`settingsRowClasses.ts`;测试:`settingsSearchCatalog.test.ts`、`AppearanceSection.accessibility.test.tsx`。验证为开发版实机截图(浅 / 深色、Eclipse 单方案、备用模型增删);其他设置页仍有 20px 单行卡片,未声明统一。+- **10-16 macOS 菜单栏余量面板改为暖色液体(B2)+ Barlow 数字**——用户反馈浅色面板和 Cindy 的配色不搭(系统冷灰毛玻璃加纯黑白液柱),并希望动效更生动、点击有反馈。用户先后看过 HTML 方案 A / B 及降低液柱对比度的 A2 / B2,选定 B2 并指定第二款数字字体(Barlow Condensed)。现行:材质上叠暖色调与左上角极淡的 Heart Orange 光晕,文字与填充改为暖灰;液柱为玻璃槽内的柔和渐变,浅色按用户要求再降一档对比度;数字与 % 号统一用 Barlow,% 约为数值的 60%,只有纯数字用 Barlow,同日用户看测试环境后改判:中英文与数字混排的文字(如「15天12时后重置」「周四 14:13」)整段用系统字体,不再把数字拆出来用窄体;“打开 Cindy”前加 Logo 的红色 `>`。动效按用户裁决只表达“正在消耗”:本机有运行中任务正在使用的来源,液面轻微荡漾,没在用的来源完全平静;不要气泡;推荐光环与低余量光晕保持静止;同日用户裁决把推荐柱的外圈描边从 1.5pt 深色减弱为 1pt 次要灰(液柱变柔和后深色描边成了最强的对比,像“选中”或“出错”),保留淡光晕,由标题前的图标与光晕负责对号入座。同日后续裁决:面板半透明,所有中性色(文字、描边、分割线、卡片、玻璃槽、液体、中性圆环)一律用暖黑 / 暖白加透明度,不再用实色灰;液体去掉渐变,改为单色加透明度;详情页圆环的 Codex 蓝、Claude 橙等品牌色保留;水柱升起时带轻微晃动,停住后再按惯性晃动并平静。同日再裁决:去掉标题前的推荐来源图标(标题文字已写明来源)和推荐柱外的光晕,推荐柱只保留 1pt 次要灰描边;鼠标移到柱子上时液面轻晃一下。被取代:v6 原型的冷灰材质、纯黑白液柱、系统数字字体与 0.5s 液柱填充。落点:DESIGN.md「macOS menu bar quota panel」与 §14.4 菜单栏动效登记;数据:`MenubarSourceCell.active`、`MenubarView.headlineAlert`;测试:`collect.test.ts`、`snapshot.test.ts`。验证为 helper 预览截图(浅 / 深、中文 / 英文、矮屏布局)与逐帧像素对比;未在真实菜单栏点开实测。- **10-13 伙伴私聊与群聊顶栏对齐任务详情:系统返回、两个独立圆钮、渐隐模糊底**——用户指出这两个聊天页的返回按钮、右上两个图标的粗细、以及顶栏下方的“分割线”都和任务详情不同。身份区按用户裁决保持靠左;返回改为与任务详情相同的系统箭头。右上待办、设置一度被合进一个玻璃胶囊并换成系统图标,用户否决:保留两个独立圆钮和原有图标,只把线宽从约 1.5pt 调到约 1.65pt。所谓分割线并不是画出来的线,而是顶栏底色不透明:私聊用实色底盖住了任务页同款的渐隐模糊,群聊顶栏与消息区上下分开,消息在顶栏下沿被直接切断。现在 iOS 上两者都浮在任务页同款的渐隐模糊上,消息从下面滚过。删除了从未接入的 `CompanionBackButton`。同日追加:用户截图指出聊天页模糊开始得太高,名字下方副标题旁的消息文字仍清晰可见。原因是通用模糊从顶栏下沿往上 24pt 开始变淡,而聊天顶栏是两行身份信息,副标题正落在变淡段。聊天顶栏改为整段保持完全模糊,只在下沿以外 16pt 内渐隐;任务页和首页的单行顶栏不变。同日再追加:用户认为设置页(系统柔和滚动边缘)的过渡更柔和。差别在于自绘顶栏只有一层固定强度的模糊,靠透明度淡出,过渡区里清楚的字和模糊的影子叠在一起;系统效果是模糊程度本身逐渐减弱。iOS 所有页面的顶栏模糊改为三层等强度模糊叠加,逐层提前淡出,形成渐进效果,外侧渐隐从 16pt 拉长到 24pt;底部输入框的模糊不变。