修复 AGC DirectProject 运行中过程卡的读秒粒度与样式 #508
Reference in New Issue
Block a user
Delete Branch "fix/recover-100ms"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
AGC DirectProject 对话区底部的运行中状态条(「陶泥儿正在处理 / 已耗时 12.4秒」)有两处退化:
formatElapsedDuration),但状态条自己新写了一份setInterval(..., 1000),绕过了对话侧唯一的useLiveNow(LIVE_TIMER_TICK_MS = 100)。小数位一秒才动一格,看着像读数卡住。team-conventions.md里「运行时用 100ms 叶子时钟刷新一位小数」这条约定此前已写好,改动没有对齐它。min-height: 78px与gap: 9px,摘要行在 DirectProject 收敛后已经不存在,那张卡实际只是 12px 单行文字撑在一只 78px 的空盒子里;状态点写死绿色、扫光是白色高光(在浅底上几乎不可见),而工作台里想覆盖成主色的两条规则选择器写的是… .project-chat-message-list > .project-chat-process-card—— 卡片渲染在消息列表外,那两条规则一直没生效。改动
读秒恢复 100ms
DirectTurnElapsed改用共享useLiveNow,删掉组件自带的 1000ms interval 与nowstate;tick 仍只订在显示耗时的那一行(叶子节点),不牵动回合列表。样式
padding: 8px 12px,去掉min-height: 78px/gap: 9px/ 死掉的margin-top;保持display: grid(单列)让header被拉满行宽,右侧「已耗时」的margin-left: auto才有余量可吃。--platform-accent(含同色光晕、color-mix渐变);标题提到--platform-text-strong,耗时改--platform-text-base并加font-variant-numeric: tabular-nums(100ms 一跳不抖)。<p>摘要行的-webkit-line-clamp样式。margin: 0 16px 8px是简写,会把上间距清零,卡片原先贴着最后一条消息。前后对照
#2f855a绿色,挂在浅色卡上--platform-accent+ 同色光晕#988476--platform-text-strong--platform-text-base+ 等宽数字验证
DirectProjectConversation+ 工作台外壳):状态条 36px 单行;600ms 内文案从18.0秒走到18.6秒(每 100ms 一格);420px 宽面板无横向溢出;prefers-reduced-motion: reduce下状态点与扫光动画均为none。apps/ai-game-creator-shell/tests/directProjectProcessStatus.test.tsx:假时钟下0.0 → 0.1 → 0.5秒,把LIVE_TIMER_TICK_MS临时改回 1000 时即红;另一条钉住「没有运行中的回合时不订阅时钟」。npx vitest run apps/ai-game-creator-shell/tests:186 passed / 1 skipped,1856 tests passed / 14 skipped。npm run typecheck(AGC)、npm run check:encoding、npm run check:doc-index、git diff --check均通过。文档
docs/project-memory/shared-memory/pitfalls.md新增一条:耗时文案的刷新粒度必须与显示精度同格,刷新一律走useLiveNow,不在视图组件里另起 interval。