Files
Jyotisha/docs/tasks/PROGRESS-chat-markdown-list-20260918.md
T

4.1 KiB
Raw Blame History

PROGRESS · 回答正文的列表渲染(2026-09-18)

  • 分支:codex/chat-markdown-list-20260918worktree .worktrees/chat-markdown-list-20260918
  • 基线:origin/staging @ 1061514f(任务书写 ea0280c1,本 worktree 从当时 origin/staging 拉出)
  • BUG962 / 963 / 964
  • Skill 版本:不变

1. 做了什么

BUG 落点
962 列表无符号 globals.css.message-markdown ul.markdown-list { list-style-type: disc }oldecimal::marker--color-ink-secondary。保持 display: grid。不动个人报告 Markdown。
963 散文被提升 chat-definition-lists.ts:收紧 isDefinitionLine,不删函数。term 不得含 。!?;!?; / 换行;body 必须单句且 ≤ 40 字;仍要连续 ≥2 段,仍跳过 fence 与已有列表。
964 思考条空 56px 新增 --consult-think-answer-gap: var(--space-3)12px),.consultation-thinking-report.message-stage-and-answer 都读它。会话作用域补 .message-markdown > *:first-child { margin-top: 0 },盖过 h2 的 --space-8。会话 .markdown-list gap 从 --space-416px)降到 --space-28px)。

BUG-356 防复发仍在:既有 fixture「月亮行运三分本命太阳……:情绪与精力契合。」等短项继续提升成 - **term**body。那些 body 最长约 10 字,远低于 40。

2. 间距口径(headless Chrome 实测)

改前(任务书 harness):思考条底 → 正文首标题 56px = 报告 gap 24 + h2 margin-top 32list-style: none

改后(本机 Chrome headlessrenderChatMarkdown + 会话作用域 CSS + Tailwind preflight 的 ul, ol { list-style: none }):

{"gapPx":12,"h2MarginTop":"0px","reportGap":"12px","listStyle":"disc","pCount":3,"liCount":2,"firstChild":"H2"}
改前 改后
.consultation-thinking-report gap --space-624px --consult-think-answer-gap12px
.message-stage-and-answer gap --space-28px 同一 token12px
会话首元素 h2 margin-top --space-832px,特指度压过清零) 0px
思考条底 → 正文首标题 56px 12px(≤ 16px
会话 .markdown-list gap --space-416px --space-28px
列表 list-style-type none disc
三段口语冒号段 三条 <li> 三个 <p>;只有文末行动是列表

截图:docs/testing/chat-markdown-list-20260918-after.png。步骤仍写在 docs/testing/chat-markdown-list-20260918.md

3. 被改的既有断言(原值 / 新值 / 原因)

文件 · 测试 原值 新值 原因
tests/chat-stream-layout.test.ts .message-stage-and-answer { gap: var(--space-2) } gap: var(--consult-think-answer-gap),并新增 thinking-report 同 token、first-child 清零、ul/ol list-style-type BUG-964 / 962
tests/rectification-agentic-entry.test.ts 同上 --space-2 同上 --consult-think-answer-gap 同一 token,校正面也走这条堆叠

chat-definition-lists.test.ts 既有「consecutive label-colon paragraphs become a markdown list」一字未改且须保持绿。

4. 测试

结果
tsc --noEmit 0 错
npm run lint 0 error / 120 warning(未新增;未顺手修)
tsx --test tests/chat-definition-lists.test.ts 3/3
tsx --test tests/chat-stream-layout.test.ts 6/6
tsx --test tests/chat-markdown-split.test.ts 5/5
tsx --test tests/markdown-code-block-contract.test.ts 5/5
tsx --test tests/rectification-agentic-entry.test.ts 43/43
npm test 全量 tests 3458 / pass 3380 / fail 78。多出来的红是本机 Windows 环境:G:\G:\… 路径加倍、symlink EPERM、无 Docker 的 database/backup。与本轮 CSS/lib 无关。任务书 Linux 基线是 3501 / 3455 / 31。
next build 未跑。本轮只动 CSS 与一个 lib,首屏 gzip 预期接近 0staging 验收时再核 / 仍 Static。

Chrome headless 改后:gapPx=12(≤16)、listStyle=disc、三段口语仍是 <p>