修复 DirectProject 对话状态条时机与被挤扁、Markdown 代码块换行与围栏解析 #511

Merged
suzmii merged 4 commits from fix/recover-100ms into master 2026-09-24 17:36:39 +08:00

4 Commits

Author SHA1 Message Date
suzmii 26eb32ea22 按 review 收口状态条与对话 Markdown 的容错
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m7s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m26s
Project CI / Backend tests (pull_request) Successful in 3m51s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m10s
Project CI / Native shell tests (pull_request) Successful in 6m3s
Project CI / Frontend tests (pull_request) Successful in 2m16s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 9m37s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m26s
Project CI / Repository checks (pull_request) Successful in 1m52s
- apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx 围栏归一化补「同一行出现第二段围栏串就跳过」判据:行内代码 `文本 ```x``` ` 的末尾那截曾被当成收场围栏拆开,凭空造出一个开场围栏、把后面的正文全变成代码
- apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx 注释补归一化顺序与行内代码判据
- apps/ai-game-creator-shell/src/view/project-development/chat/controller/useDirectProjectTurnStatus.ts 修正 displayBusy 的说明:原注释仍写着卡片只读 nativeRunning,与现状相反
- apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx 新增行内代码用例(去掉新判据即红)
- docs/project-memory/shared-memory/decision-log.md 新增 2026-09-24 条:记录卡片口径翻转(更正 2026-09-22「卡片口径取保守」那条)并处置其「running 在渲染层就没有消费者」的预言,同时记录状态条几何约束与对话 Markdown 容错口径
- docs/project-memory/shared-memory/pitfalls.md 围栏归一化条补行内代码判据
2026-09-24 16:56:49 +08:00
suzmii 20a0d08772 记录聊天 Markdown 围栏归一化的排障经验
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 1m31s
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m0s
Project CI / Backend tests (pull_request) Successful in 4m2s
Project CI / Native shell tests (pull_request) Successful in 5m54s
Project CI / Frontend tests (pull_request) Successful in 2m7s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 8m36s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 10m5s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m49s
Project CI / Repository checks (pull_request) Successful in 2m31s
- docs/project-memory/shared-memory/pitfalls.md 新增一条:模型输出会把 ``` 粘在正文行末尾,CommonMark 只认整行围栏,故必须先归一化再解析;同时记录块级 pre 与 code 都要给换行类名
2026-09-24 16:40:22 +08:00
suzmii 0daf8cdaad 修复 DirectProject 对话状态条时机与 Markdown 代码块渲染
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
- apps/ai-game-creator-shell/src/view/project-development/chat/DirectProjectChatView.tsx 状态条改为读 DirectProjectTurnStatus.displayBusy(本地命令在飞 ∪ 原生在跑),计时起点放宽到最新一个未结束回合:原先只认原生 turnRunning,而 turn.started 要等宿主应答返回才发出,模型首 token 之前那约十秒界面完全没有「正在处理」的交代
- apps/ai-game-creator-shell/src/view/project-development/chat/components/DirectProjectConversation/DirectProjectConversation.tsx 入参 nativeRunning 更名 turnInFlight 并同步注释
- apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx 块级 pre 与 code 补 whitespace-pre-wrap + break-words:窄面板里长行不再把消息拉宽、不再顶出横向滚动条
- apps/ai-game-creator-shell/src/components/ChatMarkdownMessage/index.tsx 新增 normalizeMarkdownFences:把粘在正文行里的 ``` 拆到独立行(模型常写成「…实现细节(game.js):```js」「… }```」),CommonMark 只认整行围栏,粘着的围栏会让正文被当成代码、或代码块不闭合把后续内容一起吞掉;整行/缩进围栏、行内代码、代码里的 ``` 与引用块 / 列表项开头的合法围栏都不受影响
- apps/ai-game-creator-shell/tests/ChatMarkdownMessage.test.tsx 新增粘住围栏三种场景与代码块换行契约用例
- apps/ai-game-creator-shell/tests/appSurface/chat-composer.suite.ts 补「turn.started 未到时卡片已出现且已计时」断言
- apps/ai-game-creator-shell/tests/directProjectProcessStatus.test.tsx 同步入参更名
2026-09-24 16:38:44 +08:00
suzmii 7cdbc61ffb 修复窗口变矮时对话状态条被挤扁
Project CI / AI game creator shell Rust crates (pull_request) Successful in 1m37s
Project CI / AI game creator shell Rust smoke (pull_request) Successful in 2m9s
Project CI / Backend tests (pull_request) Successful in 3m48s
Project CI / Frontend tests (pull_request) Successful in 2m1s
Project CI / Native shell tests (pull_request) Successful in 5m48s
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Successful in 9m4s
Project CI / AI game creator shell web tests (pull_request) Successful in 1m34s
Project CI / Repository checks (pull_request) Successful in 2m5s
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Successful in 10m48s
- apps/ai-game-creator-shell/src/styles.css 给 .project-chat-conversation > .project-chat-process-card 补 flex: 0 0 auto:卡片带 overflow: hidden,按 flex 规范该项自动最小尺寸归零,窗口压矮时会先被压缩(实测 300px 高挤到 33px、240px 高 24px,文字被裁),而这一列里只有消息列表该被压缩
- apps/ai-game-creator-shell/src/styles.css 把这条卡片的会话列几何规则从文件末尾移到「面板纵向布局兜底」的 flex 链旁边,内缩与不可压缩合并在同一条规则里,注释说明为什么必须是 0 0 auto
- apps/ai-game-creator-shell/tests/appSurface/project-development.suite.ts 卡片契约补 flex: 0 0 auto 断言
2026-09-24 16:21:24 +08:00