Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
3.6 KiB
3.6 KiB
PROGRESS · 报告页打磨 · 2026-09-29
任务书:
docs/tasks/TASK-report-reader-polish-20260929.md。执行:Claude(直接执行模式,产品 2026-09-29「请你开始执行」)。 分支codex/report-reader-polish-20260929,基线origin/staging=6e393780。BUG-1092~1094。
交付对照
| 编号 | 结论 | 说明 |
|---|---|---|
| R1 报告中心改版 | 完成 | 标题栏无按钮;.report-center-create 卡片居中放「生成报告」(实心,默认尺寸);下方「过往的报告」;无报告时一行「还没有个人报告。」。按钮的防重复点击、classifyCreateResponse 未改 |
| R2 到底部 | 完成 | 新组件 report-edge-jump.tsx;LazyMarkdownSection 新增 forceVisible,点击时 flushSync 挂载全部章节后滚到 scrollHeight;距底 480px 内变「回到顶部」,一次只显示一个 |
| R3 导出按钮 | 完成 | 描边、默认高度、可见文字「导出」,aria-label="导出报告" 保留 |
| R4 目录层级 | 完成 | 一级 ink / 600 / 组间 --space-3;二级缩进 --space-5 |
| R5 字段文案与表头 | 完成 | 三个标题、field_状态、p6 表头改中文 + 表下说明;状态列经 _dignity_label 去掉双写;同样的去重也用在「宫主(Bhavesh)落宫解释」表(排查时发现的同源问题) |
| R6 表格底色 | 完成 | 只作用于 .personal-report-table-wrap 与 .personal-report-fact-tables;打印 5% / 2.5% |
| R7 导出大小 | 完成 | exportByteSize = TextEncoder 字节;formatExportSize 显示「约 N KB / 约 N.N MB」;全篇与已选各一个 |
既有断言改动(原值 / 新值 / 原因)
| 文件 | 原值 | 新值 | 原因 |
|---|---|---|---|
frontend/tests/personal-report-view.test.ts「ready reports expose only the back link and accessible export icon」 |
match size="icon"、match <Download aria-hidden="true" />、match title="导出" |
doesNotMatch size="icon"、match variant="outline"、match <Download aria-hidden="true" />导出 |
§3-3:图标按钮改为带文字的描边按钮。aria-label="导出报告"、返回链接、禁用项断言不变 |
frontend/tests/report-export-drawer.test.tsx「reader actions keep only the accessible export icon」 |
title 等于「导出」 |
按钮文字等于「导出」,title 为空 |
同上。按钮数量仍为 1、对话框开合断言不变 |
frontend/tests/personal-report-entry.test.ts「entry stays on one line…」 |
match shrink-0 |
doesNotMatch shrink-0(whitespace-nowrap 仍 match) |
§3-1:按钮移出 46px 标题栏,不再与标题争宽;「一行不折」要求不变 |
frontend/tests/react-client-lifecycle-test-support.ts(测试宿主) |
无 closest / scrollTo |
增加按类名的 closest 与记录调用的 scrollTo、scrollTop/scrollHeight/clientHeight |
让「到底部」能在宿主里被真实点击验证;不影响其它用例(全量对比见下) |
测试名均未改(名字里的 "icon" 保留,避免名单消失;语义以断言为准)。
Golden
frontend/tests/fixtures/report-reader-main-fictional.json:用同一虚构输入(tests/test_report_reader_main.py::FICTIONAL)、同一引擎,分别以改前(origin/staging 的 pl9_reader_export.py)与改后模块渲染,取两者 diff 打到 golden 上。golden 与改前渲染本身只差一行 Shadbala 小数(-18.80 / -18.79,同机两次运行也会抖动,与本单无关,未带入)。golden 改动 = 标题 1 行、表头 2 行、状态列 9 行、说明 2 行、宫主表状态 7 行。
验证
(见下方「命令与结果」,由 Claude 实跑填写)