Files
cindy/docs/design-rules/container-transform.md
kirozeng 2159b27abb docs(design-rules): 修正设计规范前后矛盾的条目
对最新 main 通读后,修正能从日期、代码和产品规则直接判定的矛盾:统一 CINDY 色值的
数值源与决策记录指向、§9 示例改用 Token、红色白名单收敛到 §15.10、面板内边距与等宽
范围、焦点写法、语言范围、登录禁用态按两端分写,并退役已不存在的群聊进度胶囊登记。

不改界面数值。阴影与渐变清单、CTA 按下色等需要裁决的项未动。

Assisted-by: Cindy (https://cindy.app)
Signed-off-by: kirozeng <kirozeng@gmail.com>
2026-11-04 23:38:27 +08:00

4.3 KiB

容器形变动效

迁自 DESIGN.md §14.4,规范效力不变。文中未注明文档的 §N 均指 DESIGN.md。

Exception category: container transform (chip lifts off and grows)

  • The second sanctioned motion class (added 2026-07-21, revised 2026-07-22), exclusively for composer-toolbar controls whose trigger chip anchors the panel (permission selector / model selector / the + menu / the agent selector):
    • Definition: the panel does not simply appear over the trigger — it morphs from the trigger chip's exact geometry (position / size / pill radius / pill fill), growing while translating away as a whole, docking on the chip's opening side with a 6px gap; closing reverses back into the chip. The trigger chip stays visible and interactive throughout — clicking the chip while the panel is open closes it (preserving the "tap again in place to dismiss" muscle memory). An "in-place replacement" variant (chip hidden, panel occupying its spot) was tried and retired — it loses toggle-to-close and complicates timing; do not regress to it. Both open and close must fade as a whole, coupled with the translation (if the frames where panel and chip overlap were opaque, the chip content would flash-hide — fade in while lifting, dissolve while shrinking back); positionless pure fade-in/out is forbidden.
    • Parameters: 220ms (symmetric open/close; tightened from 300ms, finalized 2026-07-22), easing cubic-bezier(0.3, 0.9, 0.25, 1) (fast start, long settle); menu rows may stagger fade-in ≤20ms/row. This is an explicit exception to the §14.4 duration tiers, confined to this category — it must not leak into other transitions. While morphing, the panel content must not scroll (a flashing scrollbar squeezes row width and jitters row ends); enable scrolling only after the animation completes.
    • Radius interpolation: the morph's starting radius is half the chip height (e.g. 30px chip → 15px), never 9999px (interpolating 9999→12 balloons the mid-frames); the end value is the container 12px.
    • Implementation red lines: (a) must degrade to a hard cut under prefers-reduced-motion; (b) temporarily disable transitions while measuring target geometry (otherwise offsetHeight at frame 0 of a width transition lays out at the old width and measures a false height when text wraps); (c) as a one-shot open/close animation it is exempt from the "persistent animations are compositor-only" red line (docs/dev-rules/engineering-conventions.md §7), but must still hold its 220ms without dropped frames on low-end Windows, verified on hardware; (d) focus / Esc / outside-click / focus-return semantics are identical to §14.2 — morphing exempts nothing in a11y.
    • Scope boundary: only "trigger grows into panel" controls. Ordinary Dialog / ConfirmDialog / Toast / lightbox do not qualify (no chip anchor — they keep their current motion). The narrow variant (button-width expansion) is allowed only for information-bearing expansion (e.g. the recording red dot + timer, ≤240ms); purely decorative hover label reveal (e.g. + expanding the word "Add") was evaluated and removed — do not re-add.
  • Composer toolbar: two chrome tiers, one set shared between in-session and the create dialog (finalized 2026-07-22):
    • Morphing-dropdown tier (+/permission/model): bare at rest (border border-transparent bg-transparent); the pill outline appears only on hover (hover:border-[var(--border-default)] + composer-pill-bg); selected/danger tiers tint the text only, never the fill.
    • Persistent-tool tier (voice/send): permanent outline / solid CTA (voice: composer-pill-bg + border-default, hover model-trigger-hover, recording state surface-chip fill + red-dot timer expansion; send: send-btn-* neutral-inverse solid).
    • In-session (default) and the create dialog (create-agent) must match verbatim: the five shared controls (+/permission/model/voice/send) no longer fork styles by visualVariant; create-agent-control-* / create-agent-send-* must not be used for these five controls (legacy segmented token IDs remain for theme compatibility; the top mode/project/branch pills retain their existing roles). Changing any control's chrome changes both surfaces. Verify this at the real component boundary when the shared controls change.