fix/ref-persistent
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d0b15dbc54 |
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
- 进场本来就有动画(`…-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` 选择器写错,对应断言分别变红 |
||
|
|
96ae3db1df |
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
- 「生成任务」侧栏头部右上角由返回箭头(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 分支,对应断言均变红 |
||
|
|
41c59a37a0 |
style(agc): 「生成任务」侧栏做视觉与信息层级收口(行为与语义一个不动)
- 新增 `resourceCanvasAssetGenerationTasksSidebar.css`:侧栏样式独立成文件,取值全部走平台设计 token (`--platform-subpanel-fill/-border`、`--platform-panel-shadow`、`--platform-text-muted`、`--platform-line-soft`、 `--platform-neutral-*`、`--platform-accent`、`--platform-success-*`、`--platform-button-danger-*`、 `--platform-input-focus-ring`),不硬编码任何颜色,也不新增第二套色板 - 条目卡片化:素材名为主信息(加粗、单行省略)、阶段文案为次要信息(muted、小一号)、 已耗时 `font-variant-numeric: tabular-nums` + 右对齐(秒数跳动不抖)、失败原因 `overflow-wrap: anywhere` 折行不截断、「定位到素材」轻量下划线按钮 + hover 换色 - 状态徽标成体系:`data-tone` 四档——排队中 `--platform-neutral-*`(中性)、生成中 `--platform-accent` (品牌色 + 呼吸感圆点,**不做百分比**)、已完成 `--platform-success-*`、失败 `--platform-button-danger-*`; tone 映射提到模型层 `resourceCanvasAssetGenerationTaskTone`(组件只导出组件与常量,保住 react-refresh 边界) - 分栏标题小字 + 条数胶囊,两栏之间用 `--platform-line-soft` 分隔;空态只给一句简短文案 - 侧栏容器圆角 + 边框 + `--platform-panel-shadow` + `backdrop-filter: blur(10px)`;展开/折叠各有进场动画 (位移 + 淡入,不做宽度 reflow 抖动);折叠把手是竖向标签 + 在途数量胶囊;列表滚动条细样式 - 无障碍与降级:`:focus-visible` 用 `--platform-accent` 焦点环 + `--platform-input-focus-ring`; `@media (prefers-reduced-motion: reduce)` 关掉全部 animation / transition 与 hover 位移; `@media (max-width: 480px)` 下侧栏撑满可用宽度、把手收窄,不挡画布操作 - 测试:新增 `resourceCanvasAssetGenerationTasksSidebarStyle.test.ts`(用仓库既有 `tests/styleCascade.ts` 按真实层叠断言:四档 tone 互不相同且只引平台 token、tabular-nums + 右对齐、卡片圆角与 hover、 过渡与把手、细滚动条、360px 降级、reduced-motion 关动效、焦点环); 侧栏行为用例补「四种状态各自输出对应 data-tone」,并把原先断言 Tailwind 类名的部分交还给样式用例 - 未改任何行为:分栏、条数、已完成封顶 20、折叠不清列表、提交后自动展开、入口在途计数、 定位终局化、非模态(无遮罩 / 无焦点陷阱 / 不进模态遮挡判据)全部保持原样 |