Home first screen no longer carries the rectification surface or react-markdown (issue #124, BUG-1474)
page.tsx imported the whole rectification surface statically; its verification report also imported chat-markdown-view statically, which pulled react-markdown into / even though chat-message-content already loaded it lazily. - Home renders a same-named lazy wrapper; openRectificationCase starts the download with the open request and awaits it before setting the ids that mount the surface, so it still reveals once, drawn. - The markdown loader moves to lib/chat-markdown-loader; the home bootstrap awaits it before revealing a conversation with messages (no plain-text flash on ?c=). The blank home does not wait. / first load, gzip-9 of every referenced JS/CSS: 704,165 -> 609,606 B (-13.4%), still Static. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
ea7dd95757
commit
55ebdd7a95
@@ -20111,3 +20111,18 @@
|
||||
- 关联:BUG-957(窗口咨询预计算与缓存)。
|
||||
- 复发自:无
|
||||
- 修复版本:分支 `codex/window-consult-parallel-20261028`。
|
||||
|
||||
## BUG-1474 | 空白首页首屏带着整个生时校正界面和 Markdown 渲染
|
||||
|
||||
- 状态:resolved(代码 + 回归测试;待部署)
|
||||
- 首次发现 / 最近更新:2026-10-28 / 2026-10-28(issue #118 代码体检第 14、15 条 → #124)
|
||||
- 影响面:首页 `/` 首屏下载;`frontend/src/app/(app)/page.tsx`、`hooks/use-rectification-surface.ts`、`lib/home-bootstrap-run.ts`、`components/chat-message-content.tsx`。
|
||||
- 现象:大多数人打开首页只是普通对话,却要先下载、解析整个生时校正界面(题池、精炼包、分歧面板、校正棋盘等)和 react-markdown 一整套。
|
||||
- 触发条件:任何一次冷开首页。
|
||||
- 根因:`page.tsx` 静态 import `ConversationalBirthTimeRectification`。`chat-message-content` 本来已经按需加载 Markdown,但校正界面里的 `rectification-verification-report.tsx` 静态 import 了 `chat-markdown-view`,于是 Markdown 也跟着校正界面进了首屏。
|
||||
- 修复:首页改用 `conversational-birth-time-rectification-lazy.tsx`(同名组件,代码到手后同步渲染真组件);`lib/rectification-surface-loader.ts` 负责下载。`openRectificationCase` 在发开案请求时就开始下载,并和案情读取一起等它到齐后才设置会话 / 案号,所以校正界面仍是一次揭幕、不出现空白或转圈。Markdown 的加载挪到 `lib/chat-markdown-loader.ts`(组件和启动共用);首页启动落地到有消息(或可能有消息)的会话时,揭幕前等它到齐,`?c=` 打开带消息的会话不会先出纯文本再跳格式;空白首页不等。
|
||||
- 验证:`next build` 后按首页预渲染 HTML 引用的全部 JS/CSS 做 gzip-9 合计:改前 704,165 B,改后 609,606 B(−94,559 B,−13.4%);JS 528,697 B,CSS 不变;`/` 仍 ○ Static;首屏块里不再有 micromark / mdast / remark 和校正界面模块。新测试 `frontend/tests/home-lazy-rectification-20261028.test.ts`(首页只经懒加载壳引用校正界面;开案时下载与开案请求同时开始、在设置会话之前等齐;加载器只下载一次);`home-bootstrap-run.test.ts` 新增两条(带消息的 `?c=` 会话在 Markdown 到齐前不提交;空白首页不等 Markdown;前一条在改前代码上失败)。`chat-bundle-splitting-contract.test.ts` 两处断言改认新的加载器文件;`lagna-precheck-rectify-entry.test.tsx` 两条打开测试先载入校正界面代码(tsx 现场转译超过原来 20 ms 的等待;测的仍是打开意图与会话)。全量前端测试与 staging 逐条比对无新增失败。tsc 0、lint 0 error(`page.tsx` 38 条 warning 与基线相同)。
|
||||
- 防复发:上述测试。首页首屏只放普通对话必需的代码;进入某个功能才用的界面经加载器下载,并在打开流程里等齐再挂载。
|
||||
- 关联:BUG-1130(城市表挪出首屏)、BUG-1469(#120 次级页同类问题)。
|
||||
- 复发自:无
|
||||
- 修复版本:分支 `codex/home-lazy-rectification-20261028`。
|
||||
|
||||
@@ -23,3 +23,9 @@
|
||||
11. 电脑打开首页、右侧本命盘开着,问一个会写长回答的问题:回答照常逐字出来,右侧盘不闪、不跳;出字过程中拖动右侧盘的宽度、点盘上的宫位都跟手。
|
||||
12. 回答还没出字时点「停止」:提示是「停止回答并申请退回本次点数」;出了一些字以后再问一次并点停止:提示变成「停止回答,保留已生成内容并退回本次点数」。
|
||||
|
||||
## #124 首页少下载校正界面和排版组件(BUG-1474)
|
||||
|
||||
13. 清掉浏览器缓存后打开首页:问候和输入框照常一次出来;问一个问题,回答里的加粗、列表照常有格式。
|
||||
14. 侧栏点一条以前的长对话(或直接打开带 `?c=` 的对话链接):一出现就是排好版的样子,不先闪一下纯文本。
|
||||
15. 从首页进入生时校正(说「帮我做生时纠正」,或从星盘页进入):校正界面一次出现,题目和进度都在,没有空白、没有转圈。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user