Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(theme): soften CINDY sidebar selection
zqchrisc36975445251
diff --git a/apps/desktop/src/renderer/themes/__tests__/cindyDecisionData.ts b/apps/desktop/src/renderer/themes/__tests__/cindyDecisionData.tsindex 17c6cbbd1f..942e659968 100644--- a/apps/desktop/src/renderer/themes/__tests__/cindyDecisionData.ts+++ b/apps/desktop/src/renderer/themes/__tests__/cindyDecisionData.ts@@ -309,9 +309,9 @@ export const CINDY_EXPECTED_VALUES: Record<string, { light: string; dark: string'settings-theme-auto-dark': { light: '#181818', dark: '#181818' },'sidebar-action-icon': { light: '0.0 0.0% 0.0% / 0.44', dark: '0.0 0.0% 100.0% / 0.40' }, // 用户裁决 2026-10-22 墨水透明度(决策表 §9);沿革: 2026-08 §9 更新、E1D 侧栏层级 #9A9DA3/#6F6F6F'cmd-palette-item-meta': { light: 'rgba(0, 0, 0, 0.56)', dark: 'rgba(255, 255, 255, 0.55)' }, // 用户裁决 2026-10-22 墨水透明度(决策表 §9);沿革: 2026-08 §9 更新、E1D 侧栏二级暗灰- 'sidebar-item-active-foreground': { light: '#FCFCFC', dark: '#151515' }, // 2026-08 §9 更新;沿革: 用户二次改稿 2026-07-20:反相胶囊浅字/深字(同 accent-pure-cta-fg)+ 'sidebar-item-active-foreground': { light: '#292A2C', dark: '#EEEEEE' }, // Soft selection; independent from CTA foreground.'sidebar-item-active-border': { light: 'transparent', dark: 'transparent' }, // 用户三次改稿 2026-07-20:去描边- 'sidebar-item-active': { light: '214.3 5.5% 24.9%', dark: '0.0 0.0% 93.3%' }, // 用户二次改稿 2026-07-20:反相胶囊 #3C3F43/#EEEEEE(同 accent-cta-bg)+ 'sidebar-item-active': { light: '214.3 6.0% 88.0%', dark: '214.3 5.5% 24.9%' }, // Soft selection; CTA tokens retain their original values.'splash-bg': { light: '60.0 16.1% 93.9%', dark: '0 0% 9.4%' },'splash-text': { light: '0.0 0.0% 0.0% / 0.56', dark: '0.0 0.0% 100.0% / 0.55' }, // 用户裁决 2026-10-22 墨水透明度(决策表 §9)'splash-text-destructive': { light: '0.0 0.0% 10.2%', dark: '0.0 0.0% 100.0%' },diff --git a/apps/desktop/src/renderer/themes/__tests__/fixtures/builtin-theme-overrides.json b/apps/desktop/src/renderer/themes/__tests__/fixtures/builtin-theme-overrides.jsonindex 53c0d1c49c..d69c31223a 100644--- a/apps/desktop/src/renderer/themes/__tests__/fixtures/builtin-theme-overrides.json+++ b/apps/desktop/src/renderer/themes/__tests__/fixtures/builtin-theme-overrides.json@@ -357,9 +357,9 @@"settings-theme-auto-dark": "#181818","sidebar-action-icon": "0.0 0.0% 0.0% / 0.44","cmd-palette-item-meta": "rgba(0, 0, 0, 0.56)",- "sidebar-item-active-foreground": "#FCFCFC",+ "sidebar-item-active-foreground": "#292A2C","sidebar-item-active-border": "transparent",- "sidebar-item-active": "214.3 5.5% 24.9%",+ "sidebar-item-active": "214.3 6.0% 88.0%","splash-bg": "60.0 16.1% 93.9%","splash-text": "0.0 0.0% 0.0% / 0.56","splash-text-destructive": "0.0 0.0% 10.2%",@@ -545,9 +545,9 @@"settings-theme-auto-dark": "#181818","sidebar-action-icon": "0.0 0.0% 100.0% / 0.40","cmd-palette-item-meta": "rgba(255, 255, 255, 0.55)",- "sidebar-item-active-foreground": "#151515",+ "sidebar-item-active-foreground": "#EEEEEE","sidebar-item-active-border": "transparent",- "sidebar-item-active": "0.0 0.0% 93.3%",+ "sidebar-item-active": "214.3 5.5% 24.9%","splash-bg": "0 0% 9.4%","splash-text": "0.0 0.0% 100.0% / 0.55","splash-text-destructive": "0.0 0.0% 100.0%",diff --git a/apps/desktop/src/renderer/themes/builtin/cindy-dark.ts b/apps/desktop/src/renderer/themes/builtin/cindy-dark.tsindex 0839d5258e..3279c83369 100644--- a/apps/desktop/src/renderer/themes/builtin/cindy-dark.ts+++ b/apps/desktop/src/renderer/themes/builtin/cindy-dark.ts@@ -112,9 +112,9 @@ const GENERATED_OVERRIDES = {"settings-theme-auto-dark": "#181818", // Auto 预览: 新暗色底"sidebar-action-icon": "0.0 0.0% 100.0% / 0.40", // 墨水 白 40%: 三级文字(2026-10-22 用户裁决,取代实色灰)"cmd-palette-item-meta": "rgba(255, 255, 255, 0.55)", // 墨水 白 55%: 次要文字(2026-10-22 用户裁决,取代实色灰)- "sidebar-item-active-foreground": "#151515", // 反相深字(浅钮上)+ "sidebar-item-active-foreground": "#EEEEEE", // Soft selected pill with same-polarity readable foreground."sidebar-item-active-border": "transparent", // 用户三次改稿 2026-07-20:选中胶囊彻底去描边- "sidebar-item-active": "0.0 0.0% 93.3%", // 用户二次改稿 2026-07-20:反相胶囊 #EEEEEE 浅底(同 accent-cta-bg)+ "sidebar-item-active": "214.3 5.5% 24.9%", // Soft selected pill with same-polarity readable foreground."splash-bg": "0 0% 9.4%", // 页底 -> HSL"splash-text": "0.0 0.0% 100.0% / 0.55", // 墨水 白 55%: 次要文字(2026-10-22 用户裁决,取代实色灰)"splash-text-destructive": "0.0 0.0% 100.0%", // destructive splash textdiff --git a/apps/desktop/src/renderer/themes/builtin/cindy-light.ts b/apps/desktop/src/renderer/themes/builtin/cindy-light.tsindex 689453ffba..43475bb98c 100644--- a/apps/desktop/src/renderer/themes/builtin/cindy-light.ts+++ b/apps/desktop/src/renderer/themes/builtin/cindy-light.ts@@ -109,9 +109,9 @@ const GENERATED_OVERRIDES = {"settings-theme-auto-dark": "#181818", // Auto 预览: 新暗色底"sidebar-action-icon": "0.0 0.0% 0.0% / 0.44", // 墨水 黑 44%: 三级文字(2026-10-22 用户裁决,取代实色灰)"cmd-palette-item-meta": "rgba(0, 0, 0, 0.56)", // 墨水 黑 56%: 次要文字(2026-10-22 用户裁决,取代实色灰)- "sidebar-item-active-foreground": "#FCFCFC", // 用户二次改稿 2026-07-20:反相胶囊,light 深底浅字(同 accent-pure-cta-fg)+ "sidebar-item-active-foreground": "#292A2C", // Soft selected pill with same-polarity readable foreground."sidebar-item-active-border": "transparent", // 用户三次改稿 2026-07-20:选中胶囊彻底去描边- "sidebar-item-active": "214.3 5.5% 24.9%", // 用户二次改稿 2026-07-20:反相胶囊 #3C3F43 深底(同 accent-cta-bg)+ "sidebar-item-active": "214.3 6.0% 88.0%", // Soft selected pill with same-polarity readable foreground."splash-bg": "60.0 16.1% 93.9%", // 页底 -> HSL"splash-text": "0.0 0.0% 0.0% / 0.56", // 墨水 黑 56%: 次要文字(2026-10-22 用户裁决,取代实色灰)"splash-text-destructive": "0.0 0.0% 10.2%", // 正文 -> HSLdiff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex 3e78e0d411..d7f91ab23e 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -298,7 +298,7 @@ The grayscale rule is near-absolute. The following are the **only** sanctioned n> - **Permission Selector Mode Highlights** — selected risky permission modes may color only the option text/icon/checkmark and the collapsed trigger text/icon. The selected row background remains grayscale. Auto Approval uses `#417CDD` in both modes (finalized 2026-07-17, same value light/dark; replaces light #000050 / dark #00D9C5). Full Access uses Heart Orange `#EA6B17` in both modes (auto-follows warning-accent, finalized 2026-07-17). These hex values are the **default-theme palette only** — other themes may override `--perm-auto-selected-text` and `--perm-bypass-selected-text` with their own accent colors, provided both modes remain color-coded, distinguishable from each other, and visually distinct from neutral text. Tokens: `--perm-auto-selected-text` and `--perm-bypass-selected-text` in `apps/desktop/src/renderer/styles/globals.css`.> - **Shared-task Owner Crown** — the small crown immediately after the Agent/status icon uses the existing gold foreground `#F3A115` in both modes (`--warning-fg` on Desktop, `warningFg` on Mobile). This is a narrowly registered identity mark: it appears only for tasks owned by the current account, stays gold on selected rows, and never colors the title, row background, guest tasks, or an empty placeholder.> - **Diff Add Green / Diff Del Red** — GitHub-standard diff syntax colors, used on the `+` / `-` symbol glyph, the changed-line text foreground, **and the full row background** inside code-diff renderings. Applied in three places: (1) the Edit-tool DiffView card (F-MSG-6), (2) markdown ````diff`fenced code blocks in the message stream, and (3)`.diff`/`.patch`files opened in TextLightbox (the document previewer) — there hljs`.hljs-addition`/`.hljs-deletion`are forced`display: block`so the background fills to the right edge instead of stopping at the last glyph. Line-number gutter and ctx (unchanged) lines remain strictly grayscale per the layer system. **Foreground** — Add:`#22863a`Light /`#7ee787`Dark; Del:`#b31d28`Light /`#ff7b72`Dark. **Background** — Add:`#f0fff4`Light /`#033a16`Dark; Del:`#ffeef0`Light /`#67060c`Dark. Tokens:`--diff-add-fg/-bg`and`--diff-del-fg/-bg`in`apps/desktop/src/renderer/styles/globals.css`. Updated 2026-04-21: backgrounds switched from grayscale → GitHub red/green for full-row fill so additions / deletions are unambiguous at a glance.-> - **PR Status Colors (session-git-pr-context / sidebar task-info)** — closed = `--error-fg`, merged = `--focus-ring`, draft = `--text-tertiary` (single source: `PR_STATUS_COLOR` in `apps/desktop/src/renderer/features/cc-agent/gitContextPrVisuals.ts`). **Open green is split:** the session-header GitContextBadge and sidebar hover tooltip keep `--diff-add-fg` (theme-following GitHub greens). The sidebar task-info icon (registered 2026-08-17) follows the **surface**, not the theme name: it reads HSL lightness of `--sidebar` / `--sidebar-item-active` (Cindy's selected pill is inverse; many community/imported themes are not). Light surfaces use `--pr-open-on-light` `#2EA043`; dark surfaces use `--pr-open-on-dark` `#3FB950`. Both values are theme-invariant. The `#number` stays on the info-slot foreground. Open/draft PRs with `unresolvedCount > 0` add a 5px static `--status-bar-accent` corner dot on the status icon (not an AttentionDot tone). Unknown/unloaded status degrades to `--text-tertiary`. Scope is strictly PR-state surfaces; do not generalize these colors to other status systems. Mobile mirrors the semantics with its own tokens (`prStatusVisual`): open `statusDone`, merged `prMerged` (focus blue `#417CDD`), closed `statusError`, draft / unknown `textTertiary`.+> - **PR Status Colors (session-git-pr-context / sidebar task-info)** — closed = `--error-fg`, merged = `--focus-ring`, draft = `--text-tertiary` (single source: `PR_STATUS_COLOR` in `apps/desktop/src/renderer/features/cc-agent/gitContextPrVisuals.ts`). **Open green is split:** the session-header GitContextBadge and sidebar hover tooltip keep `--diff-add-fg` (theme-following GitHub greens). The sidebar task-info icon (registered 2026-08-17) follows the **surface**, not the theme name: it reads HSL lightness of `--sidebar` / `--sidebar-item-active` (selected surfaces vary by theme). Light surfaces use `--pr-open-on-light` `#2EA043`; dark surfaces use `--pr-open-on-dark` `#3FB950`. Both values are theme-invariant. The `#number` stays on the info-slot foreground. Open/draft PRs with `unresolvedCount > 0` add a 5px static `--status-bar-accent` corner dot on the status icon (not an AttentionDot tone). Unknown/unloaded status degrades to `--text-tertiary`. Scope is strictly PR-state surfaces; do not generalize these colors to other status systems. Mobile mirrors the semantics with its own tokens (`prStatusVisual`): open `statusDone`, merged `prMerged` (focus blue `#417CDD`), closed `statusError`, draft / unknown `textTertiary`._Dark Mode text uses softened neutrals to reduce eye strain: **Soft Gray** (`#d4d4d4`) for primary text, **Silver** (`#a3a3a3`) for secondary, **Stone** (`#737373`) for tertiary (per `--text-secondary` / `--text-tertiary` in `colors.ts` — the two swap between modes). Pure White (`#ffffff`) is reserved for button labels and high-contrast UI elements on dark backgrounds._@@ -1869,7 +1869,7 @@ The splash wordmark is a separate asset pair (`assets/splash/wordmark.png`, whit- **Sidebar color hierarchy** (same set for light/dark):- Body (session titles) = `text-foreground` (= `text-primary`: black ink 88% / white ink 82%, §15.16).- Secondary gray (timestamps / meta / group labels) = secondary ink (black 56% / white 55%, same as `text-secondary`), via CINDY overrides `sidebar-muted` (HSL with alpha) and `cmd-palette-item-meta`; leading icons at rest use `sidebar-action-icon` = tertiary ink (black 44% / white 40%). Since 2026-10-22 these follow the ink ladder (§15.16) instead of `#888883` / `#6F6F6F`.- - Selected pill = inverse pill: `sidebar-item-active` light `#3C3F43` / dark `#EEEEEE`, foreground `sidebar-item-active-foreground` light `#FCFCFC` / dark `#151515` (2026-08, was `#252222`), border transparent. **Any foreground sitting on `bg-sidebar-item-active` must use `text-sidebar-item-active-foreground` — `text-foreground` is forbidden there** (the token defaults to foreground, so non-CINDY themes see zero change).+ - Selected pill uses a softer surface: `sidebar-item-active` light `hsl(214.3 6% 88%)` / dark `#3C3F43`, foreground `sidebar-item-active-foreground` light `#292A2C` / dark `#EEEEEE`, border transparent. CTA colors stay independent. **Any foreground sitting on `bg-sidebar-item-active` must use `text-sidebar-item-active-foreground` — `text-foreground` is forbidden there** (the token defaults to foreground, so non-CINDY themes see zero change).- Running-state leading icons (vendor glyph / Puzzle / RadioTower / Clock) = **Thinking Orange `--warning-accent` `#EA6B17`**, breathing via `session-status-breathing`; the selected state stays orange (running outranks the inverse foreground). Mobile `statusAccent` mirrors value and priority. Persistent breathing sits on an HTML wrapper; SVG stays static (engineering conventions §7).- Assertions: ③ CINDY_EXPECTED locks the 4 token values; ⑦ adds hierarchy assertions (secondary gray clearly weaker than body; selected-pill foreground ≥4.5 on its fill).- Test maps: `NEUTRAL_PRIMARY_EXPECTED_BY_ID` / `NEUTRAL_PRIMARY_FOREGROUND_BY_ID` + `RED_EXCEPTION_ALLOWED_IDS` (replacing the pre-E1D `BRAND_RED_*` maps — archived in the decision log). Assertions ⑤/⑦/⑧ enforce exact neutrals, the red whitelist, neutral contrast, and falsifiability.diff --git a/packages/design-tokens/src/reference/themes.json b/packages/design-tokens/src/reference/themes.jsonindex 32536a7863..464d108875 100644--- a/packages/design-tokens/src/reference/themes.json+++ b/packages/design-tokens/src/reference/themes.json@@ -2361,9 +2361,9 @@"$value": {"colorSpace": "srgb","components": [- 0.082353,- 0.082353,- 0.082353+ 0.933333,+ 0.933333,+ 0.933333]},"$extensions": {@@ -2396,9 +2396,9 @@"$value": {"colorSpace": "hsl","components": [- 0,- 0,- 93.3+ 214.3,+ 5.5,+ 24.9]},"$extensions": {@@ -5594,9 +5594,9 @@"$value": {"colorSpace": "srgb","components": [- 0.988235,- 0.988235,- 0.988235+ 0.160784,+ 0.164706,+ 0.172549]},"$extensions": {@@ -5630,8 +5630,8 @@"colorSpace": "hsl","components": [214.3,- 5.5,- 24.9+ 6,+ 88]},"$extensions": {diff --git a/packages/design-tokens/src/themes/builtin.json b/packages/design-tokens/src/themes/builtin.jsonindex fe09eed88a..5b685d08f4 100644--- a/packages/design-tokens/src/themes/builtin.json+++ b/packages/design-tokens/src/themes/builtin.json@@ -954,7 +954,7 @@"sidebar-item-active-foreground": {"$type": "color","$value": "{reference.themes.cindy-dark.value-sidebar-item-active-foreground}",- "$description": "反相深字(浅钮上)"+ "$description": "Soft selected pill with same-polarity readable foreground."},"sidebar-item-active-border": {"$type": "color",@@ -964,7 +964,7 @@"sidebar-item-active": {"$type": "color","$value": "{reference.themes.cindy-dark.value-sidebar-item-active}",- "$description": "用户二次改稿 2026-07-20:反相胶囊 #EEEEEE 浅底(同 accent-cta-bg)"+ "$description": "Soft selected pill with same-polarity readable foreground."},"splash-bg": {"$type": "color",@@ -1866,7 +1866,7 @@"sidebar-item-active-foreground": {"$type": "color","$value": "{reference.themes.cindy-light.value-sidebar-item-active-foreground}",- "$description": "用户二次改稿 2026-07-20:反相胶囊,light 深底浅字(同 accent-pure-cta-fg)"+ "$description": "Soft selected pill with same-polarity readable foreground."},"sidebar-item-active-border": {"$type": "color",@@ -1876,7 +1876,7 @@"sidebar-item-active": {"$type": "color","$value": "{reference.themes.cindy-light.value-sidebar-item-active}",- "$description": "用户二次改稿 2026-07-20:反相胶囊 #3C3F43 深底(同 accent-cta-bg)"+ "$description": "Soft selected pill with same-polarity readable foreground."},"splash-bg": {"$type": "color",