Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

docs(design): 同步残留的旧实色与 U2 说法

kirozeng94833cf32d59
diff --git a/apps/desktop/src/renderer/components/settings/XUsageGuide.tsx b/apps/desktop/src/renderer/components/settings/XUsageGuide.tsx
index f50ad55815..13eb093cb0 100644
--- a/apps/desktop/src/renderer/components/settings/XUsageGuide.tsx
+++ b/apps/desktop/src/renderer/components/settings/XUsageGuide.tsx
@@ -67,11 +67,9 @@ function GuideGroup({ label, children }: { label: string; children: React.ReactN
*
* **颜色沿用 --text-tertiary(本仓 settings 说明文字的既有 token,约 157 处在用),这里
* 刻意没跟着风险组一起提到 --text-primary。** 两者的判据不同:风险组那两段叠在 warning
- * alpha 底上、且 U2 裁决把 text-secondary 的低对比明确限定在「二级信息」,所以必须换;
- * 而 text-tertiary 在 CINDY 两套主题里已经被整改到 AA(light #686B72 = 5.03、dark
- * #BFC1C4 = 7.38,cindy-*.ts 注明「整改: 非 U2 token AA」),default 主题那份值
- * (light #a3a3a3 = 2.39 / dark #737373 = 2.95)属**冻结的主题数据**,不是本组件能单方面
- * 决定的;只把这一节的说明文字提亮,会让它比 settings 里其它所有说明文字都重一档 ——
+ * alpha 底上、且文字阶梯把 text-secondary 限定在「二级信息」,所以必须换;
+ * 而 text-tertiary 是说明类文字的既有档位(CINDY 下为墨水三级档,DESIGN.md §15.16),
+ * 各主题的值都属**冻结的主题数据**,不是本组件能单方面决定的;只把这一节的说明文字提亮,会让它比 settings 里其它所有说明文字都重一档 ——
* 那是视觉取舍而非规范缺陷,留给 Dash 判断。
*/
function GuideBody({ children }: { children: React.ReactNode }) {
@@ -96,8 +94,8 @@ export function XUsageGuide({ companion = false }: { companion?: boolean } = {})
价格冲突提示)—— 图标 mt-0.5 shrink-0 顶对齐, 文本自己折行向下伸展。
**但文字色刻意不跟那份:这两段走 --text-primary, 不是 --text-secondary。**
- DESIGN.md §15.5 的 U2 裁决把 text-secondary 的低对比**明确限定在「二级信息」**
- 并承认它低于正文 4.5:1(cindy-dark.ts 就把它标成「直映: 二级信息; U2 例外」)。
+ 文字阶梯(DESIGN.md §2 / §15.16,2026-10-22 起取代 U2)把 text-secondary
+ **明确限定在「二级信息」**,它本来就低于正文 4.5:1。
而这两段是用户绑定后必须读清的公开回帖与私密仓库暴露风险, 不是二级信息;
叠上 warning-bg-soft 的橙色 alpha 底之后更差。实测(见
renderer/__tests__/xUsageGuideRiskContrast.test.ts, 有用例钉着):
@@ -105,12 +103,11 @@ export function XUsageGuide({ companion = false }: { companion?: boolean } = {})
合成底 text-secondary text-primary
default light 3.96 12.64
default dark 4.38 7.46
- CINDY light 2.71 8.77
- CINDY dark 2.09 7.09
+ CINDY (墨水阶梯,数值以测试为准)
- 四种组合下 secondary 全部低于 4.5, primary 全部 ≥7。修法是在组件内换语义色 ——
- **不能去改全局 token**: §15.5 写明 text-secondary 的值「never darken
- unilaterally」, 要改需要新的用户裁决(#1347 review 由 codex 指出 P2)。 */}
+ 表中 secondary 全部低于 4.5;primary 在四种组合下都 ≥4.5(测试钉住)。修法是在组件内换语义色 ——
+ **不能去改全局 token**: 文字阶梯任一档改值都需要新的用户裁决(原 U2 保护
+ 延续到整条阶梯,#1347 review 由 codex 指出 P2)。 */}
<GuideGroup label={t(k('riskLabel'))}>
<div className="flex gap-2 rounded-lg bg-[var(--warning-bg-soft)] px-3 py-2.5">
<AlertTriangle size={15} className="mt-0.5 shrink-0 text-[var(--warning-fg)]" />
diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.md
index 09073b84d6..50d2e83a83 100644
--- a/docs/design-rules/DESIGN.md
+++ b/docs/design-rules/DESIGN.md
@@ -1660,9 +1660,9 @@ peek 有值 → 调用方跳过重验 → 链路恢复后也不再问。两端
| Deep brand red (hover/pressed) | `#A61629` | `#A61629` |
| Background | `#F2F2ED` (warm ivory — 2026-08 revision, see 15.16) | `#181818` (pure neutral — 2026-08 revision) |
| Card / input | `#FDFDF8` | `#1F1F1F` |
-| Border | `#E4E4DF` (desktop, warm; mobile owns its own ramp since 2026-09-26 — see 15.13) | `#313131` |
-| Secondary info | `#888883` (2026-08 ruling: warmed + raised to ≥3.0, supersedes the 2026-07-20 `#8C8E94`; history in 15.5) | `#6F6F6F` |
-| Body text | `#1A1A1A` (near-black neutral; emphasis tier `#0C0C0C`) | `#D4D4D4` |
+| Border | black ink 8% (desktop, since 2026-10-22 — see 15.16; mobile owns its own ramp since 2026-09-26 — see 15.13) | white ink 10% |
+| Secondary info | black ink 56% (2026-10-22 ink ladder, supersedes `#888883` and U2; full ladder in 15.16) | white ink 55% |
+| Body text | black ink 88% (emphasis 95%) | white ink 82% (emphasis 100%) |
| Pure white | `#FFFFFF` | `#FFFFFF` |
### 15.2 Red-Boundary Test Maps(品牌红边界)
@@ -1755,8 +1755,8 @@ The splash wordmark is a separate asset pair (`assets/splash/wordmark.png`, whit
- Red is confined to semantic exceptions: `destructive`/delete, `error-*`, warning, diff red, status dots, and the explicit Mobile Beta-channel state badge (`betaChannelBadgeBackground/Foreground`, user decision 2026-08-25) — plus the login brand accent via `--login-brand-accent` (§16). The Desktop sidebar's Beta label is ordinary version text. The older `brand-login-*` tokens were retired with the wave4 white-canvas login and survive only as whitelist strings in `cindyDecisionData.ts` (harmless — the whitelist permits, it does not require).
- **send-btn family**: `send-btn-bg/-icon/-hover-bg/-pressed-bg/-disabled-bg/-disabled-icon` — CINDY overrides the whole family to the neutral four states + disabled grays (light `#444242`/`#585555` unchanged; dark shifted 2026-08 to `#323232`/`#464646`); defaults keep `--accent-cta-bg` with the opacity-85 hover. Whole family sits in `cindyDecisionData` REQUIRED_IDS + CINDY_EXPECTED, guarded by assertion ③.
- **Sidebar color hierarchy** (same set for light/dark):
- - Body (session titles) = `text-foreground` (= `text-primary`: light `#3C3F43` / dark `#D4D4D4`).
- - Secondary gray (leading icons at rest / timestamps / meta / group labels) = light `#888883` (2026-08, was `#9A9DA3`) / dark `#6F6F6F` (same as `text-secondary`); CINDY overrides `sidebar-muted` / `sidebar-action-icon` (HSL `60.0 2.1% 52.4%` / `0 0% 43.5%`) + `cmd-palette-item-meta` (hex).
+ - 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).
- 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).
diff --git a/packages/design-tokens/src/classification.json b/packages/design-tokens/src/classification.json
index eea8bf0f01..6cdce7516e 100644
--- a/packages/design-tokens/src/classification.json
+++ b/packages/design-tokens/src/classification.json
@@ -278,8 +278,8 @@
"darkKind": "hex",
"protected": {
"family": "u2-secondary-info",
- "owner": "DESIGN.md §15.5",
- "rule": "U2 二级信息色,never darken unilaterally",
+ "owner": "DESIGN.md §15.16",
+ "rule": "文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)",
"mode": "semantic-modeled"
},
"modeledAsSemantic": true
@@ -292,8 +292,8 @@
"darkKind": "hex",
"protected": {
"family": "u2-secondary-info",
- "owner": "DESIGN.md §15.5",
- "rule": "U2 二级信息色,never darken unilaterally",
+ "owner": "DESIGN.md §15.16",
+ "rule": "文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)",
"mode": "semantic-modeled"
},
"modeledAsSemantic": true
diff --git a/packages/design-tokens/src/classify.ts b/packages/design-tokens/src/classify.ts
index 6de7e329bc..ca3a68fae3 100644
--- a/packages/design-tokens/src/classify.ts
+++ b/packages/design-tokens/src/classify.ts
@@ -85,7 +85,8 @@ const NUMBER_RE = /^\d+(?:\.\d+)?$/;
* 加严保护值:治理合同 §1.1 / DESIGN.md §15。
* 两种 mode(治理合同 §3.2 的 Tier-1/Tier-3 分野):
* - semantic-modeled——Tier-1 slot(text-secondary / text-secondary-cross):
- * 照常 semantic 建模 + protected 元数据。U2 保护限制的是改值须裁决,
+ * 照常 semantic 建模 + protected 元数据。保护(原 U2,2026-10-22 起为墨水文字
+ * 阶梯,family id 沿用 u2-secondary-info)限制的是改值须裁决,
* 不是禁止迁移;「名称与用途延续」要求 DS-8 能从新真相源生成它们。
* - register-only——Tier-3 singleton(annotation-accent / login-brand-*):
* 只登记、不建模(治理合同「保留原位,逐项裁决,默认不动」)。
@@ -101,14 +102,14 @@ export const PROTECTED_IDS: Readonly<Record<string, ProtectedRule>> = {
},
'text-secondary': {
family: 'u2-secondary-info',
- owner: 'DESIGN.md §15.5',
- rule: 'U2 二级信息色,never darken unilaterally',
+ owner: 'DESIGN.md §15.16',
+ rule: '文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)',
mode: 'semantic-modeled',
},
'text-secondary-cross': {
family: 'u2-secondary-info',
- owner: 'DESIGN.md §15.5',
- rule: 'U2 二级信息色,never darken unilaterally',
+ owner: 'DESIGN.md §15.16',
+ rule: '文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)',
mode: 'semantic-modeled',
},
'login-brand-accent': {
diff --git a/packages/design-tokens/src/guards.ts b/packages/design-tokens/src/guards.ts
index bcda01bac9..e5658af22b 100644
--- a/packages/design-tokens/src/guards.ts
+++ b/packages/design-tokens/src/guards.ts
@@ -33,7 +33,7 @@ export function snapshotMismatch(what: string): string {
`${what} 与 DS-2b 冻结快照不一致。`,
'红灯不是禁令。有意改值的合法路径 = 修改 DTCG 源并生成生产输出 + 同一 PR 显式更新独立快照 + 按治理合同 §6 交证据 + 设计师批准。',
`更新方式:把实时提取结果写回 ${SNAPSHOT_RELATIVE_PATH},生产生成不可反向读取它;历史分类与导入 oracle 另行维护。`,
- '保护值(CINDY 皮肤族 DESIGN.md §15、U2 二级信息色、annotation-accent)另有比「改快照 + 设计师批准」更严的门槛,不能只更新本文件。',
+ '保护值(CINDY 皮肤族 DESIGN.md §15、CINDY 文字墨水阶梯(原 U2 二级信息色)、annotation-accent)另有比「改快照 + 设计师批准」更严的门槛,不能只更新本文件。',
'禁止为绿灯加豁免或绕加载路径。',
].join('\n');
}
diff --git a/packages/design-tokens/src/semantic-roles.ts b/packages/design-tokens/src/semantic-roles.ts
index 0933512c54..f724bedcdf 100644
--- a/packages/design-tokens/src/semantic-roles.ts
+++ b/packages/design-tokens/src/semantic-roles.ts
@@ -1,7 +1,7 @@
/**
* DS-3 第一批 semantic 角色:DESIGN.md §10 Tier-1 既有名称
* (surface / border / text / accent)+ status 语义。
- * 不改名、不发明新语义。Tier-1 受保护 slot(U2 二级信息色 text-secondary /
+ * 不改名、不发明新语义。Tier-1 受保护 slot(文字次要档,原 U2 二级信息色 text-secondary /
* text-secondary-cross)按治理合同 §3.2「名称与用途延续」照常登记——
* 保护限制的是改值须经裁决,不是禁止迁移;Tier-3 singleton(annotation-accent、
* login-brand-*)不在首批,保留原位(分类登记仍标 protected)。
diff --git a/packages/design-tokens/src/semantic/color.json b/packages/design-tokens/src/semantic/color.json
index 3182899133..be4642080d 100644
--- a/packages/design-tokens/src/semantic/color.json
+++ b/packages/design-tokens/src/semantic/color.json
@@ -229,8 +229,8 @@
"com.cindy.governance": {
"protected": {
"family": "u2-secondary-info",
- "owner": "DESIGN.md §15.5",
- "rule": "U2 二级信息色,never darken unilaterally",
+ "owner": "DESIGN.md §15.16",
+ "rule": "文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)",
"mode": "semantic-modeled"
}
}
@@ -243,8 +243,8 @@
"com.cindy.governance": {
"protected": {
"family": "u2-secondary-info",
- "owner": "DESIGN.md §15.5",
- "rule": "U2 二级信息色,never darken unilaterally",
+ "owner": "DESIGN.md §15.16",
+ "rule": "文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)",
"mode": "semantic-modeled"
}
}
@@ -259,8 +259,8 @@
"com.cindy.governance": {
"protected": {
"family": "u2-secondary-info",
- "owner": "DESIGN.md §15.5",
- "rule": "U2 二级信息色,never darken unilaterally",
+ "owner": "DESIGN.md §15.16",
+ "rule": "文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)",
"mode": "semantic-modeled"
}
}
@@ -273,8 +273,8 @@
"com.cindy.governance": {
"protected": {
"family": "u2-secondary-info",
- "owner": "DESIGN.md §15.5",
- "rule": "U2 二级信息色,never darken unilaterally",
+ "owner": "DESIGN.md §15.16",
+ "rule": "文字次要档:改值须用户裁决(2026-10-22 起墨水文字阶梯取代 U2,保护延续到整条阶梯)",
"mode": "semantic-modeled"
}
}