Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。
TypeScript agentai-agentai-assistantandroidclaude-codecodexelectroniosllmmacosreact-nativetypescriptwindows
docs(design): 按可见层与登记分配圆角并明确审查边界
kirozeng3c0841e3082e
diff --git a/AGENTS.md b/AGENTS.mdindex 4fc9774d01..8f4f3deb8b 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -62,6 +62,8 @@- 新增或修改任何界面、组件、布局、样式、动效或 UI 文案前,必须先读权威设计规范`docs/design-rules/DESIGN.md`;设计文档索引见`docs/design-rules/cindy-design-system.md`。+- 做 UI 圆角分类审查时,必须同时读 `docs/design-rules/DESIGN.md §5` 与+ `docs/design-rules/design-governance.md §13`;普通 UI 改动同样适用,不限于设计系统迁移 PR。- 新增或修改设计 Token、主题系统、标准 UI 组件(primitive / pattern)、视觉类门禁脚本,或参与设计系统迁移 PR 前,必须先读治理合同`docs/design-rules/design-governance.md`:真相源边界、兼容红线、两级证据合同与diff --git a/REVIEW.md b/REVIEW.mdindex 0fbbeb8f17..b906c5ac81 100644--- a/REVIEW.md+++ b/REVIEW.md@@ -91,6 +91,13 @@ P1/P2。按下表转换,**不要**把仓库口径的 P2 改写成评论里大小,也不因「是 bugfix/纯技术改动」豁免。- **UI 双模式**:新增或修改的界面必须同时实现 Light 与 Dark,颜色走语义 token;只适配一种模式的硬编码或条件补丁视为未完成。见 `docs/design-rules/DESIGN.md`。+- **UI 圆角分类**:普通 UI 改动同样先读 `docs/design-rules/DESIGN.md §5` 与+ `docs/design-rules/design-governance.md §13`,不只在设计系统迁移 PR 中读取。先识别+ 已登记成员覆盖的具体可见层,再核对登记值和交互约束;不得仅凭 DOM 标签、可访问名称+ 或局部样式类推导 pill。未决分类、证据缺口、违反登记值分别报告;已登记的待迁移差异+ 按 `design-inventory.md` 对应条目处理,不用相反的改形建议替代缺失裁决。+ 规范修订 PR 应按已授权的新裁决核对正文、摘要与登记的一致性,不把正在被取代的旧+ 措辞当作保留它的理由;新条款自身的实际矛盾、遗漏与越界仍须报告。- **跨平台**:macOS 与 Windows 的路径、进程、文件系统差异。- **测试**:是否通过 skip、删除或弱化断言制造通过。diff --git a/docs/design-rules/DESIGN.md b/docs/design-rules/DESIGN.mdindex 8d61abecf8..91c3478f4a 100644--- a/docs/design-rules/DESIGN.md+++ b/docs/design-rules/DESIGN.md@@ -10,15 +10,15 @@ Cindy's interface is radical minimalism applied to an AI-agent workbench — a qThe default theme lives almost entirely in grayscale. Chromatic color is reserved for a small, explicitly sanctioned set of semantic signals (status, diff, focus — see §2); everything else is shades between near-black and near-white. Long working sessions stay calm, and color means something whenever it does appear.-What makes this system distinctive is the combination of a single geometric sans-serif (Inter) with a pill-first geometry (9999px radius on interactive elements). The clean letterforms + rounded buttons + rounded containers create a cohesive "softness language" that makes a developer-oriented tool feel approachable and friendly rather than intimidating. This is minimalism with warmth — not cold Swiss-style grid minimalism, but the kind where the edges are literally softened.+What makes this system distinctive is the combination of a single geometric sans-serif (Inter) with a pill-first geometry (ordinary action frames default to pills; registered shapes and contained content are assigned separately under §5). The clean letterforms + rounded buttons + rounded containers create a cohesive "softness language" that makes a developer-oriented tool feel approachable and friendly rather than intimidating. This is minimalism with warmth — not cold Swiss-style grid minimalism, but the kind where the edges are literally softened.**Key Characteristics:**- Near-monochrome default theme; chromatic color only via the sanctioned semantic set (§2), always consumed through tokens (§10)- Inter as the single sans family, carrying both display headlines and body text-- Tight border-radius system: 4px (keyboard keycaps) / 8px (inner controls) / 12px (containers) / 9999px (pill)+- Tight border-radius system (§5): 0px / 2px (registered data marks) / 4px (keyboard keycaps) / 8px (inner controls) / 12px (containers) / 9999px (pill frames)- Zero shadows in the base language — depth comes from background color shifts and 1px borders (narrow token-gated exceptions live in §10)-- Pill-shaped geometry on interactive elements (buttons, tabs, single-line inputs, tags); visible keyboard shortcut frames use the registered 4px keycap exception (§5), and textareas use the 8px inner-control radius (§5)+- Ordinary action frames default to pills; registered shapes (keycaps and data marks) and contained content are handled as separate visible layers. Apply §5 Step 1 before the Step 2 control tiers, including the inner-control tier for textareas.- No mascots or decorative artwork in the working UI — brand imagery appears only on sanctioned brand surfaces (see §15.7 / §16)- Extreme content restraint — each surface presents one clear idea@@ -271,7 +271,7 @@ input/textivory surface="ivory" → --settings-input-bg (--surface-card-ivory). Registered debt (DS-4 G6, 2026-09-03) — colors.ts undocumented drift for white-panel dialogs; do not make it the default. Close as a separate issue.```-- **Multi-line inputs (textarea) take the 8px inner-control radius — never the pill** (tall frames deform it), whether nested in a container or standing alone in a form (§5 three-tier scale; single rule, no nesting condition). Implementation: `components/ui/input.tsx` `Textarea`.+- **Multi-line inputs (textarea) take the 8px inner-control radius — never the pill** (tall frames deform it), whether nested in a container or standing alone in a form (§5 radius scale; single rule, no nesting condition). Implementation: `components/ui/input.tsx` `Textarea`.- **Existing settings inputs retain their local theme contract** through `SettingsTextInput`, a thin wrapper over `ui/input`. It supplies the historical `settings-input-text`, `settings-input-border`, `settings-input-border-focus`, and `settings-input-placeholder` aliases via `inputClassName`. Their defaults still resolve to Tier-1; explicit local overrides stay local. Generic `Input` keeps the Tier-1 defaults above. Standard error-state border/ring takes precedence over wrapper styles. Do not promote these legacy overrides into global semantic slots or rewrite user theme files. Existing placeholder load-time normalization remains unchanged.- Placeholders must **read as clearly empty** — Silver (`#a3a3a3`) is too prominent against either Card surface (≈5:1 Dark / ≈2.6:1 Light) and reads as real input; forbidden. **Every input surface's placeholder (chat / ask / settings / plan-action-fb) resolves to `--text-placeholder`** (2026-06 G3, archived in `design-decision-log.md`); non-default themes express their own placeholder color by overriding `text-placeholder`.@@ -309,7 +309,7 @@ Reference implementation: `apps/desktop/src/renderer/components/ui/confirm-dialo- Base unit: 8px- Scale: 4px, 6px, 8px, 10px, 12px, 14px, 16px, 20px, 24px, 32px, 40px, 48px-- Button padding: 10px 24px (consistent across all buttons; bare text buttons follow their component entry, not this padding)+- Ordinary action-frame padding: 10px 24px per the §4 button entries. Registered keycaps, data marks and bare-text buttons follow their component treatments; a `<button>` tag alone does not assign this padding to a visible layer or hit region (§5 Border Radius Scale).- Container padding: dialogs 16px (`p-4`, see §4 Dialog & Modal); dropdown panels 6–8px (see §4 Select & Dropdown)### Layout Structure (App)@@ -326,16 +326,83 @@ Reference implementation: `apps/desktop/src/renderer/components/ui/confirm-dialo### Border Radius Scale-Three tiers — **these three only** (wording hardened 2026-08-29, designer ruling — see `design-decision-log.md` 08-29). **Tier assignment is a single decision tree in this §5 section; §4 component entries, the §7 Do/Don't lists and the §9 iteration guide restate it for convenience — when wording drifts, this section wins:**+*(rewritten 2026-09-07 — owner-authorized rule decision, see `design-decision-log.md` 09-07. Supersedes the 08-29 three-tier wording and folds in the 07-28 micro-cell exception and the 09-06 keycap ruling.)*-- **Pill (9999px)**: **every button is a pill — the only exemption is registered bare text buttons.** Anything that commits a decision or triggers an action wears the pill: buttons (permission approve/deny included), tabs, single-line inputs, tags, badges — including buttons with transparent or outlined fills (dialog secondary/cancel are pills with a transparent fill; a control's fill style never changes its tier). The exemption is exactly **bare text buttons with no background of their own** (wizard back-navigation "← 上一步", the §16.3 login text-button category): they have no shape to round — text, not a button-shaped control — so they carry no radius at all. Register any new bare-text-button usage in the component entry that introduces it.-- **Container (12px)**: the box that holds content — code blocks, cards, panels, dialogs. Implemented as Tailwind `rounded-xl` (12px).-- **Keyboard keycap (4px)**: every visible keyboard shortcut frame, whether rendered as `<kbd>` or as an interactive button that accepts the shortcut, uses a 4px outer radius (`rounded-[4px]`). Keep its border, fill, padding, and text colors appropriate to the surrounding control; the radius is the shared cross-surface rule. This is the sole 4px exception and keeps keyboard hints visually distinct from pill buttons and containers.-- **Inner control (8px)**: multi-line inputs (textarea) — **always 8px, whether the textarea sits inside a visible container or is the outermost control of a form area** — plus selected/hover row highlights in dropdowns/menus and small in-block cells nested inside a container. Implemented as Tailwind `rounded-lg` (8px).+**What this section assigns a radius to is a *visible layer* — one specific frame, surface, or clipping outline — not a DOM tag and not a whole component.** A single control routinely carries several: a "运行 ⌘Enter" button has a pill action frame, a 4px keycap inside it, and a hit-testing responsibility that needs no frame of its own. Assign each layer on its own. **A parent's radius is not the assignment rule for a contained layer.** A container may retain its approved content-clipping treatment, but an interaction wrapper must not use its own geometry to replace a contained mark's registered geometry.-_No 6px / 10px, and no arbitrary radii. **4px is reserved for keyboard keycaps** as defined above; other new components must not introduce it. Existing non-keycap `rounded-[4px]` usages remain registered debt. Bare `rounded` and `rounded-sm` are not substitutes for the keycap rule. Do not add tiers, and **"it looks small" is never a reason to move an element down a tier** — an element's tier follows what it IS (button / box / textarea — always 8px / nested non-button), not its size or nesting. Mind nesting: an 8px row highlight inside a 12px panel must stay smaller than its container; a pill there becomes a lozenge, 12px looks bloated._+**Assignment is a two-step decision tree. Step 1 wins over Step 2.**-> **Narrow exception — status micro-cells (2px)** (registered 2026-07-28): non-interactive status squares of 8×8px or smaller keep a 2px radius — the workflow agent status strip's cells (background-tasks panel detail + workflow chat card) and the equivalent per-category square in SystemCard. At that size any tier radius rounds the square into a dot and destroys the "block strip" read that lets a large agent fleet be scanned at a glance. Scope is exactly this: **non-interactive, ≤8px, status-only**. Do NOT generalize to buttons, tags, rows, badges or containers — those still pick a tier.+**This section is the authoritative source for radius assignment.** Component entries and the summaries in §§1, 4, 7 and 9 reference it; they do not introduce competing assignment rules. The decision log records decisions and history, not a second current-value table.++#### Step 1 — Registered shapes++**A layer uses a registered shape only when an approved entry below covers that specific visible layer and use.** The entry supplies its corner treatment. Semantic arguments support an application for registration; they do not establish membership. Adding or widening an entry requires adjudication under the design-governance process and a decision-log record. **Neither an author nor a reviewer may create membership merely by interpreting this section.**++| Category | Scope | Corner radius |+| --- | --- | --- |+| **Keyboard keycap** | Every visible keyboard shortcut frame, whether rendered as `<kbd>` or as an interactive button that accepts the shortcut. Border, fill, padding and text colors stay appropriate to the surrounding surface; the radius is the shared cross-surface rule. *(Registered 2026-09-06, #4001.)* | 4px |+| **Data mark** | A visible layer inside a chart or visualization whose shape belongs to the data rather than to the control. Members below. *(Registered 2026-09-07.)* | 0px or 2px, pinned per member |++**Overlap.** A keyboard shortcut frame retains its registered 4px treatment when another channel, such as colour, also encodes data. Data encoding alone does not override the keycap entry. Other overlaps must be resolved explicitly in the registration; listing order alone does not grant precedence.++**Registered data-mark members.** The value is fixed per member, never chosen at the call site:++| Member ID | Covered visible layer | Corner radius |+| --- | --- | --- |+| `usage-heatmap-day` | The coloured cell representing one day's usage in `UsageHeatmap`. Excludes the hit region, legend, outer container and tooltip. | 2px, all four corners |+| `usage-token-bar` | The coloured bar representing one day's token volume in `UsageTokenBars`. Excludes the hit region, outer container and tooltip. Its own clipping may follow the same treatment. Top-only rounding or square baseline corners are not variants of this registration. | 2px, all four corners |+| `workflow-status-cell` | The coloured micro-cell in the agent status strip (background-tasks panel detail + workflow chat card). | 2px, all four corners |+| `system-category-square` | The registered per-category status square in SystemCard. | 2px, all four corners |++*A member ID identifies an approved visual role, not a filename or an entire component subtree. Reuse within its stated scope and semantics-preserving refactors do not require a new radius ruling; keep implementation references current. A new role, wider scope or changed geometry requires adjudication. Component entries reference the member ID and record other dimensions and interaction details instead of maintaining a second radius value.*++*The last two members absorb the narrow "status micro-cells (2px)" exception registered 2026-07-28. Their value and their components are unchanged; what changes is the basis — they are classified by the role their shape plays, not by being ≤8px and non-interactive. See the decision log for the two scope changes this entails.*++**Evidence required to register a new data mark** — what an adjudication request must establish. **Not** a self-service test that admits a layer automatically:++1. a stable mapping from a data field to a visual channel of that layer (position, size, area, colour intensity, **or categorical colour**);+2. which visible layers belong to the data and which belong to the control, stated separately;+3. that the classification does not depend on the current number of data points, the label text, the presence of a click handler, or the rendering technology (DOM / SVG / canvas).++Ordinary input options, control selected-states and action frames do **not** enter merely by carrying data. Mixed objects are resolved in the component entry.++#### Content and unresolved shapes++**Pixels and intrinsic geometry within images, icons and other assets are not control frames.** Existing approved content and cropping treatments follow their owning component specifications; any surrounding action frame is assigned separately. Replacing an asset within such a treatment does not register a new shape.++A new content-owned outline or mixed object not covered by an existing specification **must be submitted for adjudication**. Reviewers report unresolved classification and request the missing decision; they must **neither force the object into the pill tier solely because it is clickable nor approve an unregistered exception**.++#### Step 2 — Control tiers++Ordinary control frames, containers and inner-control surfaces not covered by Step 1 use the following three tiers.++- **Pill (9999px)** — control frames: buttons, tabs, single-line inputs, tags, badges. **A control's fill style never changes its tier** — transparent and outlined fills are still pills (dialog secondary/cancel are pills with a transparent fill).+- **Container (12px)** — the box that holds content: code blocks, cards, panels, dialogs. Tailwind `rounded-xl`.+- **Inner control (8px)** — multi-line inputs (textarea), **always 8px** whether nested in a visible container or standing alone in a form; plus selected/hover row highlights in dropdowns/menus, and small in-block cells nested inside a container. Tailwind `rounded-lg`.++**A layer with no frame or surface to round needs no corner-radius assignment.** This does not authorize a control to discard its prescribed frame treatment merely by omitting a fill or border. A transient hover or pressed surface on an ordinary control remains that control's frame and takes its assigned tier.++**A focus or selection indicator is a separate visual treatment.** Its appearance alone does not create a new ordinary control frame or reclassify the associated layer. Registered bare-text buttons (wizard back-navigation "← 上一步", the §16.3 login text-button category) remain frameless and retain their visible focus treatment; new bare-text-button usages must still be registered in the introducing component entry.++Evaluate the approved component treatment across its states, including shared styles and pseudo-elements. **The absence of a local background or border class is not evidence of frameless status.**++#### Interaction constraints — apply after assignment++Making something clickable never moves a layer between Step 1 and Step 2.++- **Hit testing and mark geometry are independent responsibilities; they may share a DOM element or drawing primitive. No additional wrapper is required.** Hit-target geometry must not replace, clip or distort the mark's registered visible geometry or its data mapping. The mark's own registered clipping remains permitted. Resetting an existing radius with `rounded-none` is permitted when needed to achieve this result; **the presence or absence of a particular class is not the compliance test**.+- **Focus and selection indicators use the associated component's approved interaction treatment.** For registered marks, the component entry identifies the indicator geometry; it must not be inferred by reclassifying the mark as a pill control. An indicator may be drawn on the existing element, a pseudo-element, an overlay or the drawing surface. It must remain distinguishable without changing the mark's registered geometry or data encoding.+- **On a data-bearing layer, hover must not alter the visual mapping that encodes the data.** Use a distinguishable indicator on a separate visual layer when the relevant channel is already occupied.+- **For the same data and display configuration, a registered mark's geometry and corner treatment must not change solely because interaction is enabled or disabled.** Independent hover, focus and selection indicators are allowed.+- **Hit-target sizing.** Registered data-mark status does not itself provide an exception from pointer-target requirements. For the usage heatmap and daily-token chart, dense date targets may be retained through the **Equivalent** route of WCAG 2.2 SC 2.5.8 only when the Usage History view also provides a date-selection control that satisfies that criterion and reaches every selectable date with the same filtering result. Relative presets alone are not equivalent to arbitrary single-day selection. **Deliver this control in the same change that restores dense interactive targets.** Until it is available, do not reduce targets in reliance on a future equivalent control. Overlapping targets for different dates are not an acceptable enlargement technique. These members have no category-wide Essential exemption. Keyboard access and visible focus remain required independently.++#### Scope and inventory++*Do not invent radii. **"It looks small" is never a reason to move a layer down a tier** — within Step 2 a layer's tier follows what it IS (control frame / box / textarea), not its size or nesting. **This sentence governs Step 2 only**; it is not an argument that every clickable layer is a control. Mind nesting: an 8px row highlight inside a 12px panel must stay smaller than its container; a pill there becomes a lozenge, 12px looks bloated.*++*New tiers and new registered shapes both enter only through adjudication — neither is added by a reviewer's reading of this section.*++*Governed corner-radius values are **0px and 2px** for registered data marks, **4px** for keycaps, **8px** for inner controls, **12px** for containers, and **9999px** for pill frames. No 3px / 6px / 10px, and no arbitrary values. A layer with no frame to round needs no assignment; "no assignment" is not an additional radius value. **Intrinsic content and mark geometry remain outside this corner-radius inventory** — a scatter dot's circle, a pie sector's arc, a map outline are shapes of the mark itself. Existing non-keycap `rounded-[4px]` usages remain registered debt; bare `rounded` and `rounded-sm` substitute for nothing.*## 6. Depth & Elevation@@ -352,20 +419,20 @@ _No 6px / 10px, and no arbitrary radii. **4px is reserved for keyboard keycaps**### Do- Use Surface (`#f8f8f6` Light / `#1f1f1e` Dark) as the page background — every page starts here-- Use pill-shaped (9999px) radius on interactive elements — buttons, tabs, single-line inputs, tags. Visible keyboard shortcut frames use the registered 4px keycap exception (§5).-- Use 12px radius on all non-interactive containers — code blocks, cards, panels-- Use 8px radius for multi-line inputs (textarea, always) and non-button inner controls — dropdown/menu row highlights, in-block cells (see §5)+- Assign each visible layer using §5: check Step 1 registered shapes (keyboard keycaps and data-mark members) first; ordinary control frames then take the Step 2 pill tier.+- Use the §5 Step 2 container tier for content boxes — code blocks, cards, panels; assign contained layers separately.+- Use the §5 Step 2 inner-control tier for multi-line inputs (textarea, always), dropdown/menu row highlights and in-block cells not covered by Step 1.- Keep the palette strictly grayscale — chromatic color only via the sanctioned semantic set in §2, always through tokens- Use Inter at weight 400 / 500 for display headings (per the §3 Hierarchy rows) — hierarchy comes from size + weight, not typeface switching- Maintain zero shadows — depth comes from borders and background shifts only- Keep content density low — each section should present one clear idea- Use monospace for terminal commands and code — it's primary content, not decoration-- Keep all buttons at 10px 24px padding with pill shape — consistency is absolute (registered bare text buttons are the §5 exemption: no background, no radius, no pill padding)+- Keep ordinary action frames on their §4 component treatment and §5 assigned tier, including transient hover / pressed surfaces. Focus and selection indicators are separate treatments: their appearance alone creates no ordinary control frame and does not reclassify the associated layer. Registered bare-text buttons remain frameless with visible focus; evaluate approved states, shared styles and pseudo-elements, not only local background or border classes.### Don't- Don't introduce any chromatic color outside the sanctioned semantic set in §2 — no brand blue, no accent green, no warm tones beyond the registered exceptions-- Don't invent arbitrary radii — use the registered values: 4px (keyboard keycaps), 8px (inner controls), 12px (containers), 9999px (pill).+- Don't invent arbitrary radii — §5 governs the inventory: 0px / 2px for registered data marks (pinned per member), 4px for keycaps, 8px for inner controls, 12px for containers and 9999px for pill frames. No 3px / 6px / 10px or arbitrary values. Frameless layers need no assignment; intrinsic content and mark geometry remain outside this corner-radius inventory. Existing non-keycap `rounded-[4px]` usages remain registered debt; bare `rounded` and `rounded-sm` substitute for nothing.- Don't add shadows to any element — the flat aesthetic is intentional- Don't use font weights above 600 in UI chrome — 700 only inside the exemption domains registered in the §3 registry (that table is the single source of truth; it currently covers markdown content, hljs theme ports, login / Splash brand canvas, third-party viewers under `vendor/`, and imperative third-party APIs). Don't re-enumerate the domains here — read §3. No 800+, no in-between values, anywhere- Don't add decorative illustrations — Cindy's working UI carries no mascots or artwork; brand imagery appears only on the explicitly enumerated sanctioned brand surfaces in §15.7 / §16@@ -415,7 +482,7 @@ Cindy Mobile (React Native) has its own device-class rules (phone / pad portrait1. Focus on ONE component at a time2. Keep all values grayscale — "Stone (#737373)" not "use a light color"-3. Always specify radius from the defined tiers — pill (9999px) / container (12px) / inner control (8px — textareas always, dropdown rows & non-button inner cells) / keyboard keycap (4px). Nothing else.+3. Assign the specific visible layer through §5: check Step 1 registered shapes first (keycaps or an approved data-mark member), then use Step 2 for ordinary control frames, containers and inner-control surfaces. Keep contained content, hit testing and focus / selection indicators separate as §5 requires; submit unresolved shapes for adjudication.4. Shadows are always zero — never add them5. Weight is 400/500 for everyday chrome, 600 for rationed emphasis — 700 never appears in new UI (registered exemption domains in §3 only)6. If something feels too decorated, remove it — less is always more@@ -656,7 +723,7 @@ Applies to submit-on-Enter fields: the chat composer, goal input, ask input, etc#### Motion tokens (the only tier source)-Global tokens live in `:root` of `apps/desktop/src/renderer/styles/globals.css`; mobile (`apps/mobile`) mirrors same-name same-value constants in `src/theme/tokens.ts` (dual-platform isomorphism, same policy as color tokens, landing with the mobile motion overhaul). **New transitions/animations must reference tokens — no hardcoded durations or cubic-beziers**; 5 interaction-duration tiers + 3 curves, the same philosophy as the §5 three-tier radius. Values outside the tiers require design review first. Narrow semantic exceptions are recorded directly below.+Global tokens live in `:root` of `apps/desktop/src/renderer/styles/globals.css`; mobile (`apps/mobile`) mirrors same-name same-value constants in `src/theme/tokens.ts` (dual-platform isomorphism, same policy as color tokens, landing with the mobile motion overhaul). **New transitions/animations must reference tokens — no hardcoded durations or cubic-beziers**; 5 interaction-duration tiers + 3 curves, the same philosophy as the §5 radius scale. Values outside the tiers require design review first. Narrow semantic exceptions are recorded directly below.| Token | Value | Use || -------------------- | ------------------------------- | ---------------------------------------------------------------------------------- |@@ -696,7 +763,7 @@ long duration to leak into any other hover or transition.| Heavy overlay (modal / confirm) | In: 250ms fade + scale 0.95→1; out: 150ms | `components/ui/confirm-dialog.tsx` || Expand / collapse | base/ease-move, grid `0fr↔1fr` height + opacity | `features/cc-agent/sidebar/SectionCollapse.tsx` || List reorder | FLIP, transform translation | `components/ui/toast/ToastContainer.tsx` |-| Press | `active:scale-[0.98]` (all interactive pills/buttons) | ConfirmDialog buttons |+| Press | `active:scale-[0.98]` for ordinary pill action frames. Registered shapes follow their component interaction treatment and §5 constraints; a button tag does not authorize scaling a contained data mark or its data mapping. | ConfirmDialog buttons || Done | **the app's only sanctioned overshoot** (`status-done-pop`) | `globals.css` || Running | Opacity breathing; must sit on an HTML wrapper (`docs/dev-rules/engineering-conventions.md` §7) | `session-breathing` || Loading spinner | `animate-spinner` (`--motion-spinner-cycle`, linear full turn); HTML wrapper only, static under reduced motion | `tailwind.config.ts` |diff --git a/docs/design-rules/design-decision-log.md b/docs/design-rules/design-decision-log.mdindex 1565329f8a..39ffeaf844 100644--- a/docs/design-rules/design-decision-log.md+++ b/docs/design-rules/design-decision-log.md@@ -12,6 +12,29 @@## 2026-09+- **09-07** **圆角体系改为「可见层 + 登记驱动」,新增 data mark 类目**——+ **决策依据:** 项目所有者授权本轮采用独立评审定案;条款由 AI 整理。授权记录:*[占位,由所有者填]*。**本条确定规范目标,不表示实现已完成或视觉验收已通过。**+ **背景:同一缺陷两次发作。** ①PR #3802(09-03 合入)给用量历史热力图与每日 token 柱图加日期点击,为可点击把图元包成 `<button>`;自动 review 据 §5「every button is a pill」连提两轮 P1,作者依次给外层按钮、再给实际可见的彩色内层加 `rounded-full`,方格变圆点、柱变胶囊;另一条 24×24 命中区 P2 促使热力图 `cellSize` 12→24、柱图容器最小宽度撑到 807px 并横向滚动。#3802 记录了筛选与点击的手工验证,但缺少可复核的完整视觉验收证据,**不能据此推断无人看过界面**。②PR #4001(09-06 合入)将快捷键外框登记为 4px 特例,但保留了与之冲突的「三档且仅此三档」和「唯一豁免」措辞。+ **根因不是这两个组件,是 §5 的分类锚点。** 旧条文没有明确区分动作外框与其内部图元;在 #3802 的两轮审查中,review bot 将 `<button>` 标签作为套用 pill 的充分依据,并进一步要求实际可见的图元服从该半径。规则虽保留申请批准例外的路径,但默认分类缺少数据图元的明确分流,因而把新增交互引向形状变化。+ **裁决:**+ 1. **判定对象改为「可见层」**(某一层框 / 表面 / 裁剪轮廓),不是 DOM 标签也不是整个组件。父层半径不作为其内含层的归档依据;容器已批准的内容裁剪继续有效,但交互包装层不得用自身几何替换内含图元的登记几何。+ 2. **两步判定树,登记优先**:Step 1 已登记形状(keycap / data mark)→ Step 2 控件三档。§5 为半径归档的唯一权威,§§1/4/7/9 与组件条目只引用、不另立归档规则。+ 3. **新增 data mark 类目**,取值 `0px` 或 `2px`,**按成员钉死**,调用方无可选项。首批四个成员均为**四角 2px**:`usage-heatmap-day`、`usage-token-bar`、`workflow-status-cell`、`system-category-square`。`0px` 保留为可登记值,本批未使用。登记单位是稳定的可见角色 ID + 明确作用层,不是文件名或整个组件子树;语义不变的重构只更新引用,扩大用途或改变几何才重新裁决。+ 4. **三条判据降为登记申请时的举证要求**,不作为作者自助分类的准入门。评审反例证明其无法稳定划界:数据筛剩一条时「同构成组」失效、给 aria-label 补动作说明反而使图元掉出类目、日期选择器与灰度强度选项三条全中。+ 5. **区分「普通控件表面」与「独立焦点指示」**:无框可圆的层无需归档,但控件不得靠省略填充/边框摆脱其规定的框处理;hover / pressed 的临时表面仍是该控件的框、取其档位。**焦点或选中指示是独立视觉处理,其出现本身不创建普通控件框、不重新归类关联层**——已登记的裸文本按钮保持无框并保留可见焦点处理。判定须跨状态评估已批准的组件处理(含共享样式与伪元素);局部没有 bg/border 类不构成无框证据。+ 6. **交互不改变归类**:命中判定与图元几何是两项独立职责,**可共用同一 DOM 元素或绘制图元,不要求额外包装层**;命中几何不得替换、裁剪或扭曲图元的登记几何与数据映射。指示器可画在既有元素、伪元素、浮层或绘制表面上,但不得改变图元登记几何与数据编码。**承载数据的层上,hover 不得改动编码数据的视觉映射**。同一数据与显示配置下,登记图元的几何与角处理**不得仅因交互启用/停用而改变**;独立的 hover / focus / 选中指示允许存在。+ 7. **命中尺寸:采用 Equivalent 路径。** 用量历史同页补足覆盖全部可选日期、产生相同单日筛选结果的合规日期选择控件,与密集图表恢复**同 PR 交付**。现有相对时间范围预设不足以替代任意单日选择;在等价控件可用前,不以待办承诺缩小目标。不同日期的目标重叠不是合格的扩大手段。**此次不批准 data mark 类目的 Essential 通用豁免。** 键盘可达与可见焦点仍独立要求。+ 8. **去绝对化**:`every button` / `the only exemption` / `Anything that triggers an action` 改为「未命中 Step 1 的普通控件框」。保留「"it looks small" is never a reason to move a layer down a tier」但**限定只在 Step 2 内生效**。+ 9. **补内容轮廓与未决分类出口**:图像/图标等资产内部的像素与固有几何不是控件框,已有内容与裁剪规范按其组件规范执行,外围动作框单独归档;新的内容自有轮廓或混合对象须送裁决,评审报告分类未决、请求缺失决定,**不得仅因可点击就强制归入 pill,也不得自行批准未登记例外**。+ **两处实质范围变更,显式登记,不得默认推广:**+ - **解除 `non-interactive` 限定**:07-28 微格例外原文限定非交互;归入 data mark 后,状态微格将来可点仍为 2px。+ - **`≤8px` 不再是归类边界**:尺寸不再作为该类归档依据。已有微格的实际尺寸与用途继续留在组件条目约束,**这不是全局任意放大许可**,也不推广到所有状态徽标。+ **边界说明(非放宽):** 数值清单只穷尽受治理的角圆角,不穷尽可见几何;固有内容与图元几何在清单之外。+ **明确不改:** keycap 4px 的值与适用对象(09-06 裁决)不重开,本次只整理其归属与优先级;控件三档的数值与常规用途不变。+ **每日 token 柱:四角统一 2px。** 恢复 #3802 前柱体自身的 2px 全角处理;本次不采用上角 2px、基线两角 0,也不采用全 0。命中区与焦点/选中指示不得将柱体重新改为 pill。+ **实施状态:待迁移。** 本 PR 仅修改规范与登记,不修改产品渲染。main 上 `UsageHeatmap` 的交互/非交互半径分支、`UsageTokenBars` 的 pill 柱体以及相关命中布局,作为**已知待修差异**在迁移台账对应条目记录负责人与后续 PR,本次不记为已合规。后续视觉修复一并落实登记形状、等价单日选择与密度处理,并交付实际视觉证据。**该过渡记录不授权新增同类偏差。** 注意热力图 `3px → 2px` 是本次新裁决的视觉调整、不是原样回退;只有柱体 2px 可称恢复——后续 PR 应命名为「按裁决修复图表形状与日期选择」,不得整体描述为纯回退。+ **落点:** `DESIGN.md §5`(本节重写)、§1 line 19/21、§7 line 355/363/368、§9 line 418、§4 line 274;`design-governance.md §13`(同 PR)。+- **09-06** **键盘快捷键外框统一使用 4px 圆角(用户裁决,PR #4001)**:所有可见快捷键外框,无论使用 `<kbd>` 还是承载快捷键的交互按钮,统一采用 `rounded-[4px]`;边框、填充、内边距和文字颜色按所在表面保留上下文差异。该规则是圆角体系的注册例外,覆盖 08-29「4px 不入档」对键盘键帽的适用范围;`DESIGN.md §5` 与 `design-governance.md §10` 已同步回写。- **09-06** **首页撤掉订阅与赠送余额告知大卡(拍板人 = 用户)**——用户重申:diff --git a/docs/design-rules/design-governance.md b/docs/design-rules/design-governance.mdindex 123aa38a42..84ff2b8a98 100644--- a/docs/design-rules/design-governance.md+++ b/docs/design-rules/design-governance.md@@ -336,3 +336,4 @@ DS-4/4b 尚有公开附件交接与完整设置页/部分状态证据缺口,DSreference(走 token、非硬编码,且须在台账说明理由)、运行时派生值按 §3.4 留在代码中不强迁——这两条是合同本身开的准入,不是「新代码优先语义层」的例外漏洞;存量随各表面迁移顺带收敛,不专门开重构 PR。+4. **圆角分类审查边界:** 自动审查应先识别 §5 已登记成员及其具体可见层,再检查对应约束。未决分类、缺少证据与明确违反登记值须分开报告。**不得仅凭 DOM 标签、可访问名称或局部样式类推导 pill,也不得用建议改形状代替缺失的分类裁决。** 未登记的新例外仍须裁决;已登记的待迁移差异按对应台账处理,不重复制造相反的「修复」要求。评论应指出登记项、作用层及违反的条款,严重级别按现行审查规则判断。diff --git a/docs/design-rules/design-inventory.md b/docs/design-rules/design-inventory.mdindex 107ed1ff58..bd4be29044 100644--- a/docs/design-rules/design-inventory.md+++ b/docs/design-rules/design-inventory.md@@ -123,7 +123,7 @@ Mobile 尚未展开顶层 screen,**待 DS-7 增量发现**;数值接管在 D| `desktop.chat.new-draft` | unassigned | legacy | DESIGN.md §15.15 创建页内容位 | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.chat.orca-workflow` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.chat.scheduled` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 |-| `desktop.chat.session` | unassigned | legacy | DESIGN.md §10 语义豁免色族消费者(status / diff / 消息卡);DESIGN.md §5 2px status micro-cells | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 完整工具/推理/消息/代码/附件迁移,验证流式、长文与旧 msg 局部覆盖;保留现有保护族 |+| `desktop.chat.session` | unassigned | legacy | DESIGN.md §10 语义豁免色族消费者(status / diff / 消息卡);DESIGN.md §5 登记成员 `workflow-status-cell` / `system-category-square` | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 完整工具/推理/消息/代码/附件迁移,验证流式、长文与旧 msg 局部覆盖;保留现有保护族 || `desktop.dev.maker-experimental` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.issues.guide` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.native.app-menu` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对原生出口与平台限制;保留项登记理由、实际负责人及复查日期,不凭共享依赖记迁移完成 |@@ -138,7 +138,7 @@ Mobile 尚未展开顶层 screen,**待 DS-7 增量发现**;数值接管在 D| `desktop.overlay.toast` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.plugins.app-main` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.plugins.installed` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 |-| `desktop.settings` | unassigned | pilot | DESIGN.md §10 语义豁免色族消费者;外部主题导入保护 token(资源用量类别色在独立窗) | DS-4 / DS-4b 的 Button / Input 与 SettingsTextInput 局部兼容壳已落地;DS-6 完整表单和第二消费者,DS-8 数值同源 | DS-6 补全状态、说明与公开附件;focus、ivory/elevated 见治理 §10。旧 alias 与 slot 按作用域生效,禁止仅因同值删除局部配色;DS-6/8/9/11 按实际消费者分批核对跨 surface alias,confirm-dialog 归 DS-6 |+| `desktop.settings` | unassigned(用量图表裁决与迁移跟进:kirozeng) | pilot | DESIGN.md §10 语义豁免色族消费者;外部主题导入保护 token(资源用量类别色在独立窗);DESIGN.md §5 登记成员 `usage-heatmap-day` / `usage-token-bar` | DS-4 / DS-4b 的 Button / Input 与 SettingsTextInput 局部兼容壳已落地;DS-6 完整表单和第二消费者,DS-8 数值同源;用量图表另走普通命名的视觉修复 PR,见下方待迁移记录 | DS-6 补全状态、说明与公开附件;focus、ivory/elevated 见治理 §10。旧 alias 与 slot 按作用域生效,禁止仅因同值删除局部配色;DS-6/8/9/11 按实际消费者分批核对跨 surface alias,confirm-dialog 归 DS-6;用量图表按 2026-09-07 裁决跟进,不记为已合规 || `desktop.shell.main-layout` | unassigned | legacy | DESIGN.md §15 CINDY 皮肤族(侧栏 vibrancy / 选中 pill);外部主题导入保护 token | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.skillhub.local` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.skillhub.market` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 |@@ -150,3 +150,16 @@ Mobile 尚未展开顶层 screen,**待 DS-7 增量发现**;数值接管在 D| `desktop.window.sidebar` | unassigned | legacy | DESIGN.md §15 CINDY 皮肤族 | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.window.voice-dictionary-toast` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 || `desktop.window.voice-overlay` | unassigned | legacy | — | DS-8 提供适用数值;DS-9 按入口核对标准组件与呈现继承 | DS-9 核对实际消费者、局部 alias 与跨入口影响;保留现有保护合同,残余项登记理由、实际负责人及复查日期 |++### `desktop.settings`:用量图表圆角与命中布局待迁移(2026-09-07)++- **入口与状态:** 设置 → 用量历史(`SettingsView` → `UsageHistorySection`);这是 `desktop.settings` 的局部待迁移项,不是资源用量独立窗口。规范依据为 [`DESIGN.md §5`](./DESIGN.md#border-radius-scale) 与 [`design-decision-log.md`](./design-decision-log.md) 09-07 裁决;本次只改规范与登记,**生产实现未变,视觉验收尚未发生**。+- **Owner:** kirozeng 负责本次裁决与迁移跟进;后续实现负责人待认领并回填。**后续 PR:**「按裁决修复图表形状与日期选择」(尚未创建,编号待回填;普通命名,不占 DS 编号)。++| 登记成员 / 责任 | 已知待修差异(2026-09-07 源码核对) | 后续验收要求 |+| --- | --- | --- |+| 图元 `usage-heatmap-day` | `apps/desktop/src/renderer/components/new-chat/UsageHeatmap.tsx` 的可见彩色日格仍按交互分支取 `rounded-full` / `rounded-[3px]`。 | 两个分支均遵守 §5 的成员登记值;热力图 `3px → 2px` 是新裁决的视觉调整,不称原样回退。登记不覆盖图例、容器或 tooltip。 |+| 图元 `usage-token-bar` | `apps/desktop/src/renderer/components/settings/usage/UsageTokenBars.tsx` 的可见柱体及其自身裁剪仍用 `rounded-full`,命中按钮另有 pill 外形与焦点 / 选中指示。 | 柱体及其自身裁剪按 §5 登记恢复四角处理,不采用仅上角圆、方基线或全 0;命中区与指示器不得将柱体改回 pill。 |+| 命中布局、日期选择与指示器 | `UsageHeatmap` 的排布 `cellSize` 因交互由 12 改为 24;`UsageTokenBars` 命中宽 / 高至少 24、30 柱容器最小宽度为 807px 并横向滚动。`UsageHistorySection` 的相对范围预设和当前单日回显未提供任意单日等价选择。 | 依 §5 的 Equivalent 路径,在同页提供覆盖每个可选日期、产生相同筛选结果且满足 WCAG 2.2 SC 2.5.8 的日期选择控件,**与密度恢复同 PR 交付**;此前不缩小目标,不以不同日期的重叠热区扩容,不采用 Essential 通用豁免。组件条目须明确独立 hover / focus / 选中指示几何,保留数据映射、键盘可达与可见焦点。 |++**下一动作:** 后续一张「有意可见变化」PR 同时交付热力图格登记形状、每日 token 柱登记形状、等价单日选择控件和密度恢复四项;半径值以 §5 成员表为唯一当前值来源。按治理合同 §6 提供真实运行的 Light / Dark 证据与人工验收,AI 不得用自己产出的截图自我批准。完成前保持本条待迁移状态,回填实际负责人、PR 链接与验收结论;**此过渡记录不授权新增同类偏差**。