AGC 资源工作台三处交互收口:侧栏关闭入口合并、删除折叠把手、播放左对齐 #361

Merged
suzmii merged 9 commits from fix/agc-resource-workbench-chrome into master 2026-09-15 00:44:02 +08:00
Member

背景

AGC 客户端「资源管理」工作台这一轮把交互收口成五件事,都是验收人在真机上直接点出来的问题:任务侧栏两个关闭入口重复、左侧贴边把手常驻遮挡画布、顶部「播放」按钮居中悬浮与模式切换脱节、任务侧栏不会自己消失、以及**「定位到素材」点完依然见不到素材**。本 PR 一并处理。

问题与根因

1. 「生成任务」侧栏两个关闭入口 + 底部一条分割线

打开「生成任务」侧栏后,头部右上角是一枚 ChevronLeftaria-label="收起生成任务"),底部 footer 里还有一枚 ×aria-label="关闭生成任务"),中间由 footer 的 border-top 分割线隔开。两者是同一个 onToggleOpen,属于重复入口;头部那枚又是「返回」语义而不是「关闭」语义。红框标出的两处即本次要处理的对象:

图1:任务侧栏头部的返回箭头与底部的关闭按钮

2. 左侧贴边竖排「生成任务」把手常驻遮挡

侧栏折叠后会在画布左侧留一条竖排文字把手(game-resource-generation-tasks-handle):

图2:左侧贴边竖排把手

3. 顶部「播放」按钮居中悬浮

styles.css 里播放按钮是 position: absolute; left: 50%; transform: translateX(-50%),靠绝对定位居中悬浮,与它左边的「资源管理 / 运行」模式切换脱节:

图3:顶部工具条,播放按钮居中悬浮

4. 侧栏不会自己消失

侧栏是常驻非模态浮层,点画布、点别的面板都不会收起,只能再去点那枚关闭按钮。

5. 「定位到素材」点完见不到素材

handleResourceSelect 只改选中、不移动画布;而这张画布是 transform 平移的、资源卡不在任何滚动容器里——既有的 card.scrollIntoView() 碰不到滚动祖先。所以卡在视口外时,定位"成功了"(卡被选中、提示条收掉),但用户屏幕上什么都没有。

解决方案

  1. 侧栏关闭入口合并:头部那枚改成 X 并统一为 aria-label="关闭生成任务",删掉底部 footer(关闭按钮 + 分割线)及其全部样式。头部标题里的「在途生成任务 N」徽标保留不动。
  2. 删除折叠把手open === false 时组件直接 return null;折叠态不再需要把手上那份在途计数角标,因为工具条入口按钮本身带 生成任务 · N
  3. 播放按钮左对齐:新增 .game-workbench-view-tabs 作为左侧控件组(「资源管理 / 运行」分段 + 紧跟其后的「播放」),播放按钮改回 position: static;删掉 @media (max-width: 1000px) 里为居中悬浮做的兜底。并把播放按钮并进按钮基础外观与 :focus-visible 规则列表——新位置不再命中 .game-workbench-tabs / .game-workbench-view-actions 的选择器,漏掉会掉成零圆角、零内边距、无边框、默认字号的裸按钮(颜色规则仍然生效,肉眼容易漏)。
  4. 运行页签也保留「生成任务」入口:该入口原本被 mode === 'resources' 包住,而侧栏本体是无条件渲染的浮层、运行态一样可见——删除把手后,用户在运行态关掉侧栏就再也打不开。现改成两个页签都常驻。
  5. 失去焦点即收起:侧栏展开时挂 document 级 pointerdown 捕获监听,点在侧栏内部与那枚开合按钮以外的地方即收起。排除开合按钮本身是必须的——它自己负责 toggle,若也被判成「点外部」就会先收起再被 toggle 打开,表现为按钮失灵。
  6. 入口顺序:「生成任务」排在「依赖 / 类型」排列方式之前(动作在前、排列方式收行尾)。
  7. 定位后把视口居中到该卡:新增 centerResourceCanvasOnResource——读该卡在当前布局位置表里的 x/y 与卡片尺寸,按 canvasSize / 2 − 卡中心 × scale 求视口平移量,缩放保持不变(定位不改用户的缩放预期,与 ensureResourceBookContentVisible 同口径)。scrollIntoView 一并保留。
  8. 收起也补上退场动画:进场本来就有动画(…-enter),收起却是瞬间卸载,观感上"闪一下没了"。现在收起先播退场再卸载:open 变 false 后进入 leaving,根节点挂 is-leaving…-leave(与进场同向反向,160ms,pointer-events: none),播完才卸载;时长在组件与 CSS 两处各写一次(组件导出常量,用例钉住一致)。减动效偏好下 CSS 已关掉动画,组件同步按 0ms 处理、立即卸载。退场期间沿用收起前那一份列表lastRenderedRef)——宿主会在同一帧里收起侧栏并把在途任务收口,直接吃新 props 会让退场动画里的内容跳一下;滚动区的空态分支也改读这份冻结快照(这是调试时用假时钟用例抓到的真问题)。

改动清单

文件 改动
ResourceCanvasAssetGenerationTasksPanelView.tsx 头部 Xaria-label 统一);删 footer;折叠态 return null
resourceCanvasAssetGenerationTasksSidebar.css 删 footer / handle / handle-label / handle-badge 样式、进场动画、480px 与 reduced-motion 里的把手分支
styles.css 新增 .game-workbench-view-tabs;播放按钮改静态定位并并入基础外观与焦点环规则;删 1000px 兜底
view/project-development/index.tsx 工具条结构(左侧控件组、入口顺序、两个页签常驻入口);侧栏失去焦点自动收起;定位后画布视口居中
tests/* 断言同步 + 新增用例:关闭入口唯一、footer 不存在、折叠态不渲染任何按钮或把手、样式表不残留被删类名、播放按钮左对齐且仍在基础外观/焦点环规则内、点外部收起而点内部/开合按钮不收起、入口顺序、定位后 viewportX + 卡中心 × scale = 画布中心
docs/* PRD、AGC 入口矩阵、decision-log 同步为当前实现;新增改动前截图目录

验证

  • tsc -p apps/ai-game-creator-shell/tsconfig.json --noEmit 通过。
  • vitest run(appSurface 全量 441 条)通过;生成任务侧栏 9 条、侧栏样式 10 条、侧栏开合与入口位置 3 条、画布手动布局 9 条通过;退场动画另有「收起时先播完再卸载且内容不跳」与「is-leaving 挂动画、减动效关掉」两条断言。
  • check-encodingcheck-doc-index 通过;改动文件 prettier --list-different 无新增命中。
  • 变异验证(改回旧行为 → 对应断言确实变红):还原播放按钮基础外观规则、还原折叠把手与 footer、还原折叠态早返回、把「生成任务」入口退回 mode 分支、关掉自动收起 effect、把入口挪回排列方式之后、摘掉定位后的居中、把 CSS 的 is-leaving 选择器写错,共 9 处。

状态

标记 WIP,原因:

  • 等待视觉回归与真机确认(≤1000px 窄屏工具条换行、播放按钮实际像素、失去焦点收起的时机手感)。
  • CI 里 Native shell tests 与部分 Rust 分片在 base 上就是红的1877aea33 的 master 运行同样 Native shell tests failure;日志里是 error[E0425]: cannot find function normalize_windows_policy_path in this scope),与本批前端改动无关,需要单独处理。
  • 本 PR 只改前端资源工作台与文档,不涉及 Rust。
## 背景 AGC 客户端「资源管理」工作台这一轮把交互收口成五件事,都是验收人在真机上直接点出来的问题:任务侧栏两个关闭入口重复、左侧贴边把手常驻遮挡画布、顶部「播放」按钮居中悬浮与模式切换脱节、任务侧栏不会自己消失、以及**「定位到素材」点完依然见不到素材**。本 PR 一并处理。 ## 问题与根因 ### 1. 「生成任务」侧栏两个关闭入口 + 底部一条分割线 打开「生成任务」侧栏后,头部右上角是一枚 `‹`(`ChevronLeft`,`aria-label="收起生成任务"`),底部 footer 里还有一枚 `×`(`aria-label="关闭生成任务"`),中间由 footer 的 `border-top` 分割线隔开。两者是同一个 `onToggleOpen`,属于重复入口;头部那枚又是「返回」语义而不是「关闭」语义。红框标出的两处即本次要处理的对象: ![图1:任务侧栏头部的返回箭头与底部的关闭按钮](https://git.genarrative.world/git/GenarrativeAI/Genarrative/raw/branch/fix/agc-resource-workbench-chrome/docs/technical/assets/agc-resource-workbench-ui-before-20260914/01-task-sidebar-two-close-entries.jpg) ### 2. 左侧贴边竖排「生成任务」把手常驻遮挡 侧栏折叠后会在画布左侧留一条竖排文字把手(`game-resource-generation-tasks-handle`): ![图2:左侧贴边竖排把手](https://git.genarrative.world/git/GenarrativeAI/Genarrative/raw/branch/fix/agc-resource-workbench-chrome/docs/technical/assets/agc-resource-workbench-ui-before-20260914/02-left-rail-collapse-handle.jpg) ### 3. 顶部「播放」按钮居中悬浮 `styles.css` 里播放按钮是 `position: absolute; left: 50%; transform: translateX(-50%)`,靠绝对定位居中悬浮,与它左边的「资源管理 / 运行」模式切换脱节: ![图3:顶部工具条,播放按钮居中悬浮](https://git.genarrative.world/git/GenarrativeAI/Genarrative/raw/branch/fix/agc-resource-workbench-chrome/docs/technical/assets/agc-resource-workbench-ui-before-20260914/03-toolbar-play-centered.jpg) ### 4. 侧栏不会自己消失 侧栏是常驻非模态浮层,点画布、点别的面板都不会收起,只能再去点那枚关闭按钮。 ### 5. 「定位到素材」点完见不到素材 `handleResourceSelect` 只改选中、不移动画布;而这张画布是 **transform 平移**的、资源卡不在任何滚动容器里——既有的 `card.scrollIntoView()` 碰不到滚动祖先。所以卡在视口外时,定位"成功了"(卡被选中、提示条收掉),但用户屏幕上什么都没有。 ## 解决方案 1. **侧栏关闭入口合并**:头部那枚改成 `X` 并统一为 `aria-label="关闭生成任务"`,删掉底部 footer(关闭按钮 + 分割线)及其全部样式。头部标题里的「在途生成任务 N」徽标保留不动。 2. **删除折叠把手**:`open === false` 时组件直接 `return null`;折叠态不再需要把手上那份在途计数角标,因为工具条入口按钮本身带 `生成任务 · N`。 3. **播放按钮左对齐**:新增 `.game-workbench-view-tabs` 作为左侧控件组(「资源管理 / 运行」分段 + 紧跟其后的「播放」),播放按钮改回 `position: static`;删掉 `@media (max-width: 1000px)` 里为居中悬浮做的兜底。**并把播放按钮并进按钮基础外观与 `:focus-visible` 规则列表**——新位置不再命中 `.game-workbench-tabs` / `.game-workbench-view-actions` 的选择器,漏掉会掉成零圆角、零内边距、无边框、默认字号的裸按钮(颜色规则仍然生效,肉眼容易漏)。 4. **运行页签也保留「生成任务」入口**:该入口原本被 `mode === 'resources'` 包住,而侧栏本体是无条件渲染的浮层、运行态一样可见——删除把手后,用户在运行态关掉侧栏就再也打不开。现改成两个页签都常驻。 5. **失去焦点即收起**:侧栏展开时挂 document 级 `pointerdown` 捕获监听,点在侧栏内部与那枚开合按钮以外的地方即收起。排除开合按钮本身是必须的——它自己负责 toggle,若也被判成「点外部」就会先收起再被 toggle 打开,表现为按钮失灵。 6. **入口顺序**:「生成任务」排在「依赖 / 类型」排列方式**之前**(动作在前、排列方式收行尾)。 7. **定位后把视口居中到该卡**:新增 `centerResourceCanvasOnResource`——读该卡在当前布局位置表里的 x/y 与卡片尺寸,按 `canvasSize / 2 − 卡中心 × scale` 求视口平移量,**缩放保持不变**(定位不改用户的缩放预期,与 `ensureResourceBookContentVisible` 同口径)。`scrollIntoView` 一并保留。 8. **收起也补上退场动画**:进场本来就有动画(`…-enter`),收起却是瞬间卸载,观感上"闪一下没了"。现在收起先播退场再卸载:`open` 变 false 后进入 `leaving`,根节点挂 `is-leaving` 播 `…-leave`(与进场同向反向,160ms,`pointer-events: none`),播完才卸载;时长在组件与 CSS 两处各写一次(组件导出常量,用例钉住一致)。减动效偏好下 CSS 已关掉动画,组件同步按 0ms 处理、立即卸载。退场期间**沿用收起前那一份列表**(`lastRenderedRef`)——宿主会在同一帧里收起侧栏并把在途任务收口,直接吃新 props 会让退场动画里的内容跳一下;滚动区的空态分支也改读这份冻结快照(这是调试时用假时钟用例抓到的真问题)。 ## 改动清单 | 文件 | 改动 | | --- | --- | | `ResourceCanvasAssetGenerationTasksPanelView.tsx` | 头部 `‹` → `X`(`aria-label` 统一);删 footer;折叠态 `return null` | | `resourceCanvasAssetGenerationTasksSidebar.css` | 删 footer / handle / handle-label / handle-badge 样式、进场动画、480px 与 reduced-motion 里的把手分支 | | `styles.css` | 新增 `.game-workbench-view-tabs`;播放按钮改静态定位并并入基础外观与焦点环规则;删 1000px 兜底 | | `view/project-development/index.tsx` | 工具条结构(左侧控件组、入口顺序、两个页签常驻入口);侧栏失去焦点自动收起;定位后画布视口居中 | | `tests/*` | 断言同步 + 新增用例:关闭入口唯一、footer 不存在、折叠态不渲染任何按钮或把手、样式表不残留被删类名、播放按钮左对齐且仍在基础外观/焦点环规则内、点外部收起而点内部/开合按钮不收起、入口顺序、定位后 `viewportX + 卡中心 × scale = 画布中心` | | `docs/*` | PRD、AGC 入口矩阵、decision-log 同步为当前实现;新增改动前截图目录 | ## 验证 - `tsc -p apps/ai-game-creator-shell/tsconfig.json --noEmit` 通过。 - `vitest run`(appSurface 全量 **441 条**)通过;生成任务侧栏 9 条、侧栏样式 10 条、侧栏开合与入口位置 3 条、画布手动布局 9 条通过;退场动画另有「收起时先播完再卸载且内容不跳」与「is-leaving 挂动画、减动效关掉」两条断言。 - `check-encoding`、`check-doc-index` 通过;改动文件 `prettier --list-different` 无新增命中。 - **变异验证**(改回旧行为 → 对应断言确实变红):还原播放按钮基础外观规则、还原折叠把手与 footer、还原折叠态早返回、把「生成任务」入口退回 `mode` 分支、关掉自动收起 effect、把入口挪回排列方式之后、摘掉定位后的居中、把 CSS 的 is-leaving 选择器写错,共 9 处。 ## 状态 标记 WIP,原因: - 等待视觉回归与真机确认(≤1000px 窄屏工具条换行、播放按钮实际像素、失去焦点收起的时机手感)。 - **CI 里 `Native shell tests` 与部分 Rust 分片在 base 上就是红的**(`1877aea33` 的 master 运行同样 `Native shell tests` failure;日志里是 `error[E0425]: cannot find function normalize_windows_policy_path in this scope`),与本批前端改动无关,需要单独处理。 - 本 PR 只改前端资源工作台与文档,不涉及 Rust。
suzmii added 1 commit 2026-09-14 22:01:10 +08:00
AGC 资源工作台三处交互收口:侧栏关闭入口合并、删除折叠把手、播放左对齐
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Failing after 2m14s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 2m9s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Failing after 2m53s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 2m46s
Project CI / AI game creator shell Rust smoke (pull_request) Failing after 1m53s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m5s
Project CI / Frontend tests (pull_request) Successful in 4m28s
Project CI / Native shell tests (pull_request) Failing after 4m57s
Project CI / Repository checks (pull_request) Successful in 3m30s
Project CI / Backend tests (pull_request) Successful in 7m19s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m21s
96ae3db1df
- 「生成任务」侧栏头部右上角由返回箭头(ChevronLeft / aria-label=收起生成任务)改为关闭 X,并与底部那枚重复的 X 统一为同一个 aria-label=关闭生成任务
- 删除「生成任务」侧栏底部 footer(关闭按钮 + border-top 分割线):关闭入口只留头部一枚
- 删除「生成任务」侧栏折叠态的左侧贴边竖排把手(handle 及其标签 / 在途角标 / 进场动画 / 悬停位移):折叠后组件不再渲染任何常驻入口
- 清理上述删除留下的悬空样式:focus-visible 分组选择器、480px 窄屏媒体查询与 prefers-reduced-motion 块里的把手分支
- 工具条「生成任务」入口移出 `mode === 'resources'` 分支:两个页签下都常驻。侧栏本体本来就是无条件渲染的浮层,运行态可见;入口只留资源页签时,切到运行关掉侧栏就再也打不开(此前靠左侧贴边把手兼作运行态入口)
- 工具条把「播放」移到「资源管理 / 运行」右侧并左对齐:新增 .game-workbench-view-tabs 作为左侧控件组,播放按钮由 absolute + left:50% + translateX(-50%) 的居中悬浮改为 static;相应删除 max-width:1000px 里的居中兜底规则
- 播放按钮并进按钮基础外观与 focus-visible 规则列表:新位置不再命中 .game-workbench-tabs / .game-workbench-view-actions 的选择器,漏掉会掉成零圆角、零内边距、无边框、默认字号的裸按钮(颜色规则仍生效,肉眼容易漏)
- 播放按钮保持两个页签下都常驻(回到改动前的可见性):运行视图空态与预览失败态要靠它重跑
- 同步更新断言:侧栏关闭入口唯一且 footer 不存在、折叠态不渲染任何按钮或把手、样式表不残留被删类名、播放按钮声明为左对齐静态定位且仍在基础外观/焦点环规则内
- 生成任务用例补回机器证据:折叠后工具条按钮的 data-resource-generation-task-count 归零、重开后头部「在途生成任务 0」徽标跟上收口结果、运行页签下侧栏仍能重开(先用 aria-selected 钉住真的切了页签);用例夹具新增 runnable 开关把首个原型标成完成
- 同步文档现状:PRD 顶部播放按钮与任务侧栏进度面两条、AGC 栏目画布底部工具栏入口矩阵的侧栏形态、decision-log 的进度面形态决策

验证:tsc -p apps/ai-game-creator-shell/tsconfig.json --noEmit 通过;vitest appSurface 全量 440 条通过、生成任务侧栏 8 条与侧栏样式 9 条通过;check-encoding 通过;prettier --list-different 未新增命中(project-development/index.tsx 属基线既有非格式化文件);变异验证:还原播放按钮基础外观规则、还原折叠把手与 footer、还原折叠态早返回、把「生成任务」入口退回 mode 分支,对应断言均变红
suzmii added 1 commit 2026-09-14 22:03:20 +08:00
AGC 资源工作台交互收口:补充改动前三处截图对照图
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 2m1s
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Failing after 2m7s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 2m19s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m18s
Project CI / Repository checks (pull_request) Successful in 3m30s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Failing after 2m16s
Project CI / AI game creator shell Rust smoke (pull_request) Failing after 2m2s
Project CI / Native shell tests (pull_request) Failing after 4m28s
Project CI / Frontend tests (pull_request) Successful in 4m13s
Project CI / Backend tests (pull_request) Successful in 7m9s
Project CI / AI game creator shell web tests (pull_request) Successful in 2m59s
9e709ce727
- 新增 docs/technical/assets/agc-resource-workbench-ui-before-20260914/:任务侧栏两个关闭入口、左侧贴边折叠把手、顶部播放按钮居中悬浮三张改动前截图
- 新增该目录 README,逐图说明改动前的问题与同步过的文档口径,供 PR 与后续回归对照
suzmii force-pushed fix/agc-resource-workbench-chrome from baa93f5e3a to 9e709ce727 2026-09-14 22:03:20 +08:00 Compare
suzmii added 1 commit 2026-09-14 22:29:29 +08:00
AGC 生成任务侧栏:失去焦点自动收起、入口挪到排列方式之前
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Failing after 2m4s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 1m53s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Failing after 2m2s
Project CI / AI game creator shell Rust smoke (pull_request) Failing after 1m32s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 1m58s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m56s
Project CI / Repository checks (pull_request) Successful in 3m45s
Project CI / Frontend tests (pull_request) Successful in 4m12s
Project CI / Native shell tests (pull_request) Failing after 4m48s
Project CI / Backend tests (pull_request) Successful in 7m7s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m17s
45ccc58969
- 侧栏展开时挂 document 级 pointerdown 捕获监听:点在侧栏内部与工具条那枚开合按钮以外的地方(画布、其他工具条按钮、对话框)即自动收起侧栏
- 排除开合按钮本身:它自己负责 toggle,若在「点外部」里也命中会先收起再被 toggle 打开,表现为按钮失灵
- 工具条「生成任务」入口加 data-resource-generation-task-toggle 标记,供上面的判定排除
- 「生成任务」入口从资源排列方式之后挪到之前:动作在前、排列方式(依赖 / 类型)收在行尾;入口抽成可复用元素,资源页签与运行页签各渲染一次,同一时刻只渲染一处
- 新增 tests/resourceCanvasGenerationTasksSidebarDismiss.test.tsx:点外部收起、点内部与开合按钮不收起且仍能 toggle、入口排在依赖/类型之前

验证:tsc --noEmit 通过;vitest(新用例 3 条 + 生成任务侧栏 8 条 + 侧栏样式 9 条 + 画布手动布局 9 条)通过;变异验证:关掉自动收起 effect 与把入口挪回排列方式之后,对应断言分别变红
suzmii added 1 commit 2026-09-14 22:36:36 +08:00
AGC 资源画布:定位到素材后把视口居中到该卡
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Failing after 2m38s
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (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
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Has been cancelled
96971403ee
- 根因:`handleResourceSelect` 只改选中、不移动画布,而这张画布是 transform 平移的、资源卡不在任何滚动容器里;既有的 `card.scrollIntoView()` 碰不到滚动祖先,卡在视口外时用户看到的就是「定位过去了但依然见不到素材」
- 新增 `centerResourceCanvasOnResource`:读该卡在当前布局位置表里的 x/y 与卡片尺寸,按 `canvasSize / 2 − 卡中心 × scale` 求视口平移量;缩放保持不变(定位不改用户缩放预期,与 `ensureResourceBookContentVisible` 同口径)
- 聚焦链在「选中新资源」那一步之后调用它;`scrollIntoView` 保留(栏目页仍有带滚动条的祖先)
- 用例:新增「centers the canvas viewport on the located asset so it is actually visible」,用渲染进 DOM 的真实画布尺寸断言 `viewportX + 卡中心 × scale = 画布中心`
- 文档:decision-log 补「失去焦点即收起」与「定位必须让素材真的可见」两条决策;AGC 入口矩阵同步自动收起、入口顺序与定位居中口径

验证:tsc --noEmit 通过;appSurface 全量 441 条通过;变异验证:把定位链里的居中调用摘掉,新用例变红(450 vs 400,正好是画布宽 800 的一半与旧视口之差)
suzmii added 1 commit 2026-09-14 23:01:40 +08:00
AGC 生成任务侧栏:收起也补上退场动画,退场期间内容不跳
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Failing after 2m52s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Failing after 2m58s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Failing after 2m59s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Failing after 3m2s
Project CI / AI game creator shell Rust smoke (pull_request) Failing after 1m40s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m2s
Project CI / Native shell tests (pull_request) Failing after 6m29s
Project CI / Repository checks (pull_request) Failing after 4m3s
Project CI / Backend tests (pull_request) Successful in 9m6s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m13s
Project CI / Frontend tests (pull_request) Has been cancelled
d0b15dbc54
- 进场本来就有动画(`…-enter`),收起却是瞬间卸载,观感上"闪一下没了"。现在收起先播退场再卸载:`open` 变 false 后进入 `leaving`,根节点挂 `is-leaving` 播 `…-leave`(与进场同向反向,160ms,`pointer-events: none`),播完才卸载
- 时长在组件与 CSS 两处各写一次,组件导出 `RESOURCE_CANVAS_ASSET_GENERATION_TASKS_LEAVE_MILLIS` 并由用例钉住两处一致
- 减动效偏好下 CSS 已关掉动画,组件那边同步按 0ms 处理,收起立即卸载,不白等 160ms
- 退场期间沿用收起前那一份列表(`lastRenderedRef`):宿主会在同一帧里收起侧栏并把在途任务收口,直接吃新 props 会让退场动画里的内容跳一下;滚动区的空态分支也改读这份冻结快照,不能读实时 `ordered`(这是本批调试时用假时钟用例抓到的真问题)
- 用例:面板用例新增「收起时先播完收起动画再卸载,动画期间列表内容不跳」;样式用例新增「is-leaving 挂上收起动画、pointer-events: none、减动效同样关掉」;既有生成任务相关性用例改为等退场动画走完再断言(新增 `waitForTasksSidebarLeaveAnimationToFinish`)
- 文档:AGC 入口矩阵与 decision-log 同步退场动画口径

验证:tsc --noEmit 通过;appSurface 全量 441 条通过;侧栏面板 9 条、样式 10 条、开合与入口 3 条通过;变异验证:把早返回改回「立即卸载」与把 CSS 的 `is-leaving` 选择器写错,对应断言分别变红
suzmii added 1 commit 2026-09-14 23:11:58 +08:00
Merge branch 'master' into fix/agc-resource-workbench-chrome
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m13s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m33s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m35s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m41s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m52s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m3s
Project CI / Frontend tests (pull_request) Successful in 5m34s
Project CI / Repository checks (pull_request) Failing after 4m36s
Project CI / Backend tests (pull_request) Successful in 7m57s
Project CI / Native shell tests (pull_request) Successful in 8m11s
Project CI / AI game creator shell web tests (pull_request) Successful in 5m5s
38928167f4
suzmii marked the pull request as ready for review 2026-09-14 23:15:01 +08:00
suzmii added 1 commit 2026-09-14 23:26:07 +08:00
AGC 资源工作台工具条:统一行内间距,「依赖 / 类型」不再与前一按钮贴得过近
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 4m53s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m42s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m29s
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
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
e272492f25
- 现象:工具条动作行里「资源面板 / 生成素材 / 整理画布 / 生成任务」之间是 gap 7px + 两侧 padding 11px = 视觉 24px,而「整理画布 → 生成任务 → 依赖」这一段只有 gap 7px + 分段控件自带 padding 3px = 10~13px,一行里两套间距;截图量出来的词间距是 64/65/65px,换算后正好差在这一段落上
- 根因:`.game-workbench-tabs.game-resource-sort-tabs` 把分段控件的 `padding: 3px` 归零后,它和同容器兄弟之间就只剩行本身的 7px gap,而其余按钮靠自身左右 padding 各撑出 11px
- 修法:给分段控件补 `margin-left: 17px`(7 + 17 = 24px),整行只剩一套间距;分段控件内部仍是 0 间距的连通分段(依赖 / 类型 共享边界不变),高度 36px 与其余按钮对齐的既有口径不变
- 用例:`resourceCanvasGenerationTasksSidebarDismiss.test.tsx` 新增「依赖 / 类型 与前一按钮之间的间距跟行内其他按钮一致」,钉住 `margin-left: 17px` 与 `padding: 0` 两条声明

验证:tsc --noEmit 通过;appSurface 全量 441 条通过;侧栏开合与入口 4 条、画布手动布局 9 条通过;变异验证:把 `margin-left` 改回 0,新用例变红
suzmii added 1 commit 2026-09-14 23:33:39 +08:00
AGC 资源工作台工具条:把布局状态提示移出动作行,按钮间距不再随提示文案变长而变化
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 4m41s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 4m22s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m2s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 4m25s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 4m36s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 2m34s
Project CI / Repository checks (pull_request) Failing after 3m33s
Project CI / Frontend tests (pull_request) Successful in 6m19s
Project CI / Native shell tests (pull_request) Successful in 7m26s
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
40e2a1b9b1
- 根因(按真机截图逐像素量出来的):动作行 `game-workbench-view-actions` 里除了按钮还挂着 `game-resource-reorder-status` 这个 `role="status"` 提示,它是 flex 子项、`white-space: nowrap`,文案从空 →「保存中」→「布局已保存」→ 失败原因会越变越长,于是把右侧按钮按文本宽度顶开:同一份截图里「资源面板→生成素材」「生成素材→整理画布」的空隙是 64/66px,而「整理画布→生成任务」是 80px,差值正是这条提示当时的宽度(10px × 8 字符 ≈ 16px)
- 修法:把它从动作行里搬出来,改成工具条内的绝对定位(`bottom: 4px; left: 12px`,`max-width` + 省略号兜底),不再参与行内排版;四枚动作按钮的内容宽度实测都是 132~134px,间距因此只剩一套
- 保留上一笔的分段控件 `margin-left: 17px`:它解决的是另一半——分段控件内部 0 间距导致它与前一按钮只隔 10px,而其余按钮之间是 24px
- 用例:新增「布局状态提示不参与动作行排版,不会按文案宽度顶开按钮」,钉住 `position: absolute` 与锚点;既有「布局已保存」文本断言(按文本查,不依赖它在哪个容器)不受影响
- 文档:AGC 入口矩阵补「工具条动作行的间距只有一套」口径,写清提示为什么不进这一行

验证:tsc --noEmit 通过;appSurface 全量 441 条通过;侧栏开合与入口 5 条、画布手动布局 9 条通过;变异验证:把提示改回 `position: static`,新用例变红
suzmii added 1 commit 2026-09-15 00:03:15 +08:00
修复两个 CSS 文件末尾多出的空行(CI git diff --check 报 new blank line at EOF)
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Successful in 5m21s
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Successful in 5m26s
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Successful in 5m9s
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Successful in 5m16s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m1s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 3m21s
Project CI / Frontend tests (pull_request) Failing after 3m36s
Project CI / Native shell tests (pull_request) Successful in 7m39s
Project CI / AI game creator shell web tests (pull_request) Successful in 3m1s
Project CI / Backend tests (pull_request) Successful in 12m59s
Project CI / Repository checks (pull_request) Successful in 18m21s
0aa6dfe994
- resourceCanvasAssetGenerationTasksSidebar.css:文件末尾由 ``}\n\n\n`` 收敛为 ``}\n``,与 origin/master 的结尾字节一致
- styles.css:同上(此前由编辑工具补写整文件时多留了两个空行)
- 两处都只删结尾空白,文件内容与行尾风格(LF)不变
suzmii merged commit 0ced0c2564 into master 2026-09-15 00:44:02 +08:00
suzmii deleted branch fix/agc-resource-workbench-chrome 2026-09-15 00:44:12 +08:00
Sign in to join this conversation.