WIP: 补充 AGC 动效层与交互反馈系统主规范及首个里程碑文档 #576

Draft
suzmii wants to merge 2 commits from feat/agc-ui-motion-ux into master
Member

关联 Issue #563。

本 PR 当前只含文档产物,用于让方案进入评审。按 AGENTS.md,「复杂 UI 状态链路」属必须走 SDD 的范围,评审通过后再按里程碑逐个落地代码。

为什么是这个方案

调研后的判断:这个需求的根因不是「动效太少」,而是 AGC 没有动效层。

现状 证据
动效依赖装了但零使用 package.json:243 有 motion@^12.23.24,vite.config.ts:649 已为它切 motion-vendor chunk,全仓库零 import
设计 token 不覆盖时间维度 packages/shared/src/theme.css 有 100+ 个 --platform-*,无一个 duration / easing
时长各自为政 styles.css 中 23 处 transition 用了 120 / 140 / 150 / 160 / 180ms 五种值
曲线已漂移成两份 CSS 里 cubic-bezier(0.2, 0.8, 0.2, 1)(styles.css:797)vs TS 里 cubic-bezier(0.2, 0.78, 0.2, 1)(resourceBookController.ts:23)
无障碍未成体系 prefers-reduced-motion 仅覆盖 5 处

反馈点名的两个对象也已核实:

  • 「开始生成」= view/home/index.tsx:305-319,一个 28px 圆形 ArrowUp,全部动效是 hover:scale-105。
  • 工作台终止钮 ComposerControls.tsx:455 注释原文写着「Codex 的停止方块」;对应 .project-chat-submit-button(styles.css:3091)是 #1f6feb 通用蓝,连 transition 都没有。反馈里「我们不是 codex」有了字面证据。
  • 预览区 .local-game-preview-frame(styles.css:2659)只有黑底 + iframe,无进场、无加载态、无高亮。

所以顺序是先立地基再改表现,否则会一边加动效一边制造新的不一致。

复用而非新写

  • ui-editor-status-attention(styles.css:738-830)已是一套克制的三段式强调(落位 + 扩散 + 呼吸),且带 reduced-motion 降级,注释明确「收敛动画但不收敛可见性」。首次生成引导泛化它。
  • resourceBook 已有完整 JS 动效引擎(420ms + 最小时长下限 + reduced-motion 抑制)。
  • tests/styleCascade.ts 支持声明级 CSS 断言,已有 6 个样式测试 —— 动效可被测试钉死,不会改回去。
  • 低频功能收纳复用既有 OverflowActions。

里程碑

  1. 动效 token 层(本 PR 的实施计划已就绪):建 token + token 层 reduced-motion 兜底 + 并入曲线孤本 + 门禁。零视觉变化。
  2. 交互反馈统一:23 处 transition 收口,补齐 hover / active / focus-visible / disabled 四态。
  3. 主行动入口重设计:「开始生成」与发送 / 终止钮重做,通用色值接回 token。
  4. 首次生成引导与动线分层:预览区一次性强调,高低频分层。

两个明确的不做项

  1. 不引入 motion 库做路由级页面转场。 AGC 是桌面壳 + 离线前端,转场拖慢体感,且向渲染层引新运行时依赖收益不匹配。全部用 CSS token + 既有 JS 引擎。已切好的 motion-vendor 保持原状。
  2. 不重构 13021 行 styles.css 的结构。 本次只收口动效声明,文件拆分是独立议题。

本次验证

  • npm run check:encoding 通过(5174 文件)。
  • git diff --check 无异常。
  • 纯文档变更,无代码、无契约、无 schema 改动。

请评审

  • M3 的「生成 / 点燃」意象方向是否符合面向游戏创作者的预期?
  • 上面两个不做项是否认可?

🤖 Generated with Claude Code

关联 Issue #563。 本 PR 当前**只含文档产物**,用于让方案进入评审。按 `AGENTS.md`,「复杂 UI 状态链路」属必须走 SDD 的范围,评审通过后再按里程碑逐个落地代码。 ## 为什么是这个方案 调研后的判断:这个需求的根因不是「动效太少」,而是 **AGC 没有动效层**。 | 现状 | 证据 | | ---- | ---- | | 动效依赖装了但零使用 | `package.json:243` 有 `motion@^12.23.24`,`vite.config.ts:649` 已为它切 `motion-vendor` chunk,全仓库零 import | | 设计 token 不覆盖时间维度 | `packages/shared/src/theme.css` 有 100+ 个 `--platform-*`,无一个 duration / easing | | 时长各自为政 | `styles.css` 中 23 处 transition 用了 120 / 140 / 150 / 160 / 180ms 五种值 | | 曲线已漂移成两份 | CSS 里 `cubic-bezier(0.2, 0.8, 0.2, 1)`(`styles.css:797`)vs TS 里 `cubic-bezier(0.2, 0.78, 0.2, 1)`(`resourceBookController.ts:23`) | | 无障碍未成体系 | `prefers-reduced-motion` 仅覆盖 5 处 | 反馈点名的两个对象也已核实: - 「开始生成」= `view/home/index.tsx:305-319`,一个 28px 圆形 `ArrowUp`,全部动效是 `hover:scale-105`。 - 工作台终止钮 `ComposerControls.tsx:455` 注释原文写着「Codex 的停止方块」;对应 `.project-chat-submit-button`(`styles.css:3091`)是 `#1f6feb` 通用蓝,**连 transition 都没有**。反馈里「我们不是 codex」有了字面证据。 - 预览区 `.local-game-preview-frame`(`styles.css:2659`)只有黑底 + iframe,无进场、无加载态、无高亮。 所以顺序是**先立地基再改表现**,否则会一边加动效一边制造新的不一致。 ## 复用而非新写 - `ui-editor-status-attention`(`styles.css:738-830`)已是一套克制的三段式强调(落位 + 扩散 + 呼吸),且带 reduced-motion 降级,注释明确「收敛动画但不收敛可见性」。首次生成引导泛化它。 - `resourceBook` 已有完整 JS 动效引擎(420ms + 最小时长下限 + reduced-motion 抑制)。 - `tests/styleCascade.ts` 支持声明级 CSS 断言,已有 6 个样式测试 —— **动效可被测试钉死,不会改回去。** - 低频功能收纳复用既有 `OverflowActions`。 ## 里程碑 1. **动效 token 层**(本 PR 的实施计划已就绪):建 token + token 层 reduced-motion 兜底 + 并入曲线孤本 + 门禁。**零视觉变化。** 2. **交互反馈统一**:23 处 transition 收口,补齐 hover / active / focus-visible / disabled 四态。 3. **主行动入口重设计**:「开始生成」与发送 / 终止钮重做,通用色值接回 token。 4. **首次生成引导与动线分层**:预览区一次性强调,高低频分层。 ## 两个明确的不做项 1. **不引入 `motion` 库做路由级页面转场。** AGC 是桌面壳 + 离线前端,转场拖慢体感,且向渲染层引新运行时依赖收益不匹配。全部用 CSS token + 既有 JS 引擎。已切好的 `motion-vendor` 保持原状。 2. **不重构 13021 行 `styles.css` 的结构。** 本次只收口动效声明,文件拆分是独立议题。 ## 本次验证 - `npm run check:encoding` 通过(5174 文件)。 - `git diff --check` 无异常。 - 纯文档变更,无代码、无契约、无 schema 改动。 ## 请评审 - M3 的「生成 / 点燃」意象方向是否符合面向游戏创作者的预期? - 上面两个不做项是否认可? 🤖 Generated with [Claude Code](https://claude.com/claude-code)
suzmii added 1 commit 2026-10-01 19:08:50 +08:00
补充 AGC 动效层与交互反馈系统主规范及首个里程碑文档
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
deb95c2474
新增主规范 docs/technical/【前端架构】AGC动效层与交互反馈系统-2026-10-01.md,确立动效 token 唯一事实源、四态反馈、主行动入口定位、首次生成引导与 reduced-motion 降级口径
明确两项非目标:不引入 motion 库做路由级页面转场,不重构 styles.css 文件结构
新增里程碑规范 docs/project-memory/plans/【里程碑】AGC动效token层-2026-10-01.md,交付零视觉变化的动效 token 地基
新增实施计划 docs/project-memory/plans/【实施计划】AGC动效token层-2026-10-01.md,钉住修改边界、实现顺序、验证命令与回滚点
docs/README.md 前端架构索引挂入该主规范

关联 Issue #563

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
suzmii added 1 commit 2026-10-05 18:46:09 +08:00
Merge branch 'master' into feat/agc-ui-motion-ux
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m59s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m44s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m53s
Project CI / Frontend tests (pull_request) Successful in 3m39s
Project CI / Backend tests (pull_request) Successful in 8m27s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Successful in 8m56s
Project CI / Repository checks (pull_request) Successful in 7m21s
ea665f84f9
Some checks are pending
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 6m59s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 4m44s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 5m53s
Project CI / Frontend tests (pull_request) Successful in 3m39s
Project CI / Backend tests (pull_request) Successful in 8m27s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m37s
Project CI / Native shell tests (pull_request) Successful in 8m56s
Project CI / Repository checks (pull_request) Successful in 7m21s
This pull request is marked as a work in progress.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/agc-ui-motion-ux:feat/agc-ui-motion-ux
git checkout feat/agc-ui-motion-ux
Sign in to join this conversation.