Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
5.2 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 实跑,Linux,Node 22.14 / Python 3.11 .venv-review)
| 项 | 结果 |
|---|---|
tsc --noEmit |
0 错 |
npm run lint |
0 error,126 warning(与基线 6e393780 相同) |
npm test(全量) |
基线 4,357 / fail 24;本分支 4,364 / fail 24。失败名单逐条相同,全是无 Docker 的数据库 / 部署套件。测试名单只增不减(新增 7 条,消失 0 条) |
| 过程中发现 | 首版把「到底部」状态放在文章视图里,撞上「article markdown trees are memoized and hold no scroll state」合同;改为外部信号(只由懒渲染章节订阅),合同原样通过,提交 156162f6 |
next build |
/ 仍 ○ Static |
首屏 gzip-9(index.html 引用的 26 个脚本合计) |
基线 643,258 B → 643,265 B(+7 B,+0.001%) |
Python 定向 tests/test_report_reader_main.py |
全部通过(含新增 1 条) |
Python 快速门 run_quality_gate.py --profile quick |
Python 步 1000 passed / 2 skipped;门内 npm test 步用的是系统 Node 20,67 条失败属环境(同一套件用 Node 22 跑见上一行,与基线一致) |
环境缺口
- 浏览器级真机验收:无登录态与 Chrome,清单见
docs/testing/report-reader-polish-20260929.md。 - 数据库套件:无 Docker,未跑;本单不动表。
部署核对(2026-09-29 Claude)
Gitea 门禁 validate → publish → migrate → deploy 全部 success;https://staging.jyotisha.chat/api/health 的 deployment.gitCommit = d7772011(含本单的最近一次门禁提交),status: ok;/login 200,未登录 /api/account 401。公开 health 不暴露 swisseph_available(内部项),未核对。