Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
fix(theme): retain running icon contrast on selected rows
zqchris6b4d6f4137a0
diff --git a/apps/desktop/src/renderer/themes/__tests__/cindyDecisionData.ts b/apps/desktop/src/renderer/themes/__tests__/cindyDecisionData.tsindex 942e659968..666a11eccf 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: '#292A2C', dark: '#EEEEEE' }, // Soft selection; independent from CTA foreground.+ 'sidebar-item-active-foreground': { light: '#292A2C', dark: '#EEEEEE' }, // 调参 2026-10-29(#7838):柔化选中态,文字与 CTA 独立。'sidebar-item-active-border': { light: 'transparent', dark: 'transparent' }, // 用户三次改稿 2026-07-20:去描边- '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.+ 'sidebar-item-active': { light: '214.3 6.0% 99.0%', dark: '214.3 5.5% 24.9%' }, // 调参 2026-10-29(#7838):近白浅色选中底保留运行橙 ≥3:1,CTA 不变。'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__/cindyThemes.test.ts b/apps/desktop/src/renderer/themes/__tests__/cindyThemes.test.tsindex 05e86df851..4525fa284e 100644--- a/apps/desktop/src/renderer/themes/__tests__/cindyThemes.test.ts+++ b/apps/desktop/src/renderer/themes/__tests__/cindyThemes.test.ts@@ -493,6 +493,16 @@ describe('CINDY · ⑦ WCAG 复算 + 文字墨水阶梯反向冻结', () => {expect(contrast(cindyDark.colors['sidebar-item-active-foreground']!, cindyDark.colors['sidebar-item-active']!), 'dark 选中胶囊 前景×中性底').toBeGreaterThanOrEqual(4.5);});+ // Unit regression #7838: running task/timer icons retain status-bar-accent even when selected.+ // The existing text contrast assertion cannot detect orange disappearing into a selected fill.+ it('CINDY 运行图标×选中行底色对比度 ≥3:1', () => {+ for (const [name, theme] of THEMES) {+ const mode = name === 'cindy-dark' ? 'dark' : 'light';+ const running = resolveIn(theme.colors, 'status-bar-accent', mode);+ expect(contrast(running, theme.colors['sidebar-item-active']), `${mode} 运行橙×选中底`).toBeGreaterThanOrEqual(3);+ }+ });+it('CINDY 侧栏草稿铅笔×普通/悬停行底色对比度 ≥3:1', () => {const draftLight = colorRegistry.resolveDefault('sidebar-draft-indicator', 'light') ?? '';const draftDarkAlias = colorRegistry.resolveDefault('sidebar-draft-indicator', 'dark') ?? '';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 d69c31223a..848ba6e16c 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@@ -359,7 +359,7 @@"cmd-palette-item-meta": "rgba(0, 0, 0, 0.56)","sidebar-item-active-foreground": "#292A2C","sidebar-item-active-border": "transparent",- "sidebar-item-active": "214.3 6.0% 88.0%",+ "sidebar-item-active": "214.3 6.0% 99.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%",diff --git a/apps/desktop/src/renderer/themes/builtin/cindy-light.ts b/apps/desktop/src/renderer/themes/builtin/cindy-light.tsindex 43475bb98c..50eb42328c 100644--- a/apps/desktop/src/renderer/themes/builtin/cindy-light.ts+++ b/apps/desktop/src/renderer/themes/builtin/cindy-light.ts@@ -111,7 +111,7 @@ const GENERATED_OVERRIDES = {"cmd-palette-item-meta": "rgba(0, 0, 0, 0.56)", // 墨水 黑 56%: 次要文字(2026-10-22 用户裁决,取代实色灰)"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 6.0% 88.0%", // Soft selected pill with same-polarity readable foreground.+ "sidebar-item-active": "214.3 6.0% 99.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 d7f91ab23e..5d683c70ee 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -1869,8 +1869,8 @@ 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 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).+ - Selected pill uses a softer surface: `sidebar-item-active` light `hsl(214.3 6% 99%)` / 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 selected foreground), with contrast ≥3:1 against the selected fill in both modes. 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.- Backlog: the five R2 §4.3 Project_List deviations stay deferred (see the decision log backlog).diff --git a/packages/design-tokens/src/reference/themes.json b/packages/design-tokens/src/reference/themes.jsonindex 464d108875..fe543e1f43 100644--- a/packages/design-tokens/src/reference/themes.json+++ b/packages/design-tokens/src/reference/themes.json@@ -5631,7 +5631,7 @@"components": [214.3,6,- 88+ 99]},"$extensions": {