fix(home): warm return to / without replaying the loading ring (BUG-1040)
Coming back to / from /chart, /ephemeris, /reports or /people by client navigation remounted Home from hydrated=false and replayed the whole bootstrap: model catalog, consult status, entry summary and daily card, 3-5 round trips plus up to 4 s of reveal budget, every time. The reveal now counts per document load, not per mount: - lib/home-warm-snapshot.ts: memory-only, per-account snapshot of the model catalog, rectification entry summary, session cursor and today's card (keyed by person + birth fingerprint + day). Account, profile and the session list already survive in SessionListProvider. Cleared on account change, sign-out, provider 401 and redirectToLogin. - lib/home-warm-start.ts: Home's useState initializers take one warm decision per mount. Complete snapshot + settled list + complete profile + a landing computable in memory -> start ready, landing resolved with the cold-path functions (?new=1, ?c=, login-return stash and its person scope from BUG-1038). Anything missing or needing a lookup -> the unchanged cold path (no half-reveal, BUG-1021). - runHomeWarmRefresh commits the landing, then refreshes catalog, account and background-consultation recovery in the background (recovery shares resolveReservedConsultation with the cold path). Summary and daily card refresh through their existing effects. - Next renders the new page before it writes the address bar, so AppLink / navigateAppPath note the target href (lib/client-navigation-target.ts); unknown target -> cold path. Home() useState 33 / useRef 37 unchanged; page.tsx 1329 -> 1373 lines. Tests: home-warm-return-lifecycle (13, real Home + sidebar + provider, navigating in Next's render-then-write-URL order; 11 fail with warm start disabled) and home-warm-snapshot (12). Full suite 3953 / 61 failing, failure names identical to the 3928 / 61 baseline. Build: / stays Static, rootMainFiles gzip 130933 B unchanged. Local Chrome with every /api/* held 1.5 s: /chart -> 新建对话 interactive in 18-23 ms with no loading ring (baseline 5530 ms with ring). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
bd669aed90
commit
638b6a60c0
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 48 KiB |
@@ -0,0 +1,31 @@
|
||||
# 从其他页面回首页不再放加载动画 · 真人验收(2026-09-26)
|
||||
|
||||
关联:`docs/tasks/TASK-home-warm-return-20260926.md`、`docs/tasks/PROGRESS-home-warm-return-20260926.md`、BUG-1040。
|
||||
|
||||
## 前置与记录边界
|
||||
|
||||
- 本清单尚未执行。本机只在本地 `next start` + Chrome 151 无头、用虚构账户(林遥)和虚构数据走过前三项,截图见 `home-warm-return-20260926-chart-new-chat.png`、`home-warm-return-20260926-reports-history.png`;不以此代替登录态真机。
|
||||
- 在本轮已部署的 staging 用受控测试账号;先核对 `/api/health` 的 `deployment.gitCommit`。不借用他人登录态。
|
||||
- 测试账号需要:资料完整(有出生时间)、至少一条普通咨询、一条生时校正会话;星盘档案里至少一个他人。
|
||||
- 打开浏览器开发者工具的网络面板(iPhone 可用 Mac 上的 Safari「开发」菜单连手机)。只记方法、路径、先后与耗时,不保存 Cookie、JWT、请求正文、会话 ID 或出生资料。
|
||||
- 每项记录:通过 / 未通过、设备与浏览器、日期、脱敏现象(截图可以,遮住姓名)。
|
||||
|
||||
## 必验
|
||||
|
||||
| 步骤 | 操作 | 预期 |
|
||||
| --- | --- | --- |
|
||||
| 1 | 打开首页,等加载动画结束。点侧栏「星盘」,等星盘页出来,再点侧栏「新建对话」 | **不出现**「正在载入账户 / 正在准备对话」加载环;首页立刻可输入,标题「新对话」,中间是开场问候与「今日星语」「生时校正」两个入口;地址为 `/`(没有 `new=1`)。网络面板:首页可输入之前没有任何请求在等;之后出现的 `/api/models`、`/api/consult/status`、`/api/account`、`/api/rectification/cases/entry-summary`、`/api/daily-starlanguage` 都在页面已可用之后,结果到了页面不闪、不回加载态 |
|
||||
| 2 | 分别从「星历」「我的报告」「星盘档案」重复步骤 1(桌面一次、iPhone 抽屉一次) | 与步骤 1 一致;手机抽屉点完关闭 |
|
||||
| 3 | 首页 → 「我的报告」→ 点侧栏里一条历史普通咨询 | 不出现加载环;直接打开那条对话,地址 `/?c=…`;消息已看过的立刻显示,没看过的消息区先留白再出现,不转圈 |
|
||||
| 4 | 在首页按浏览器刷新(或关掉标签页重新打开) | 仍然**放一次**加载环,然后正常进入;这是预期 |
|
||||
| 5 | 首页打开一条生时校正会话 → 点「星盘」→ 点左下角自己的头像回首页 | 不出现加载环;回到那条生时校正,校正界面正常打开,输入框不停在「正在打开生时校正…」 |
|
||||
| 6 | 登出,换另一个受控账号登录,进首页 → 「星盘」→「新建对话」 | 登录后第一次有加载环;之后回首页不放;页面上的名字、余额、今日星语、校正入口都是新账号的,**没有**上一个账号的任何内容 |
|
||||
| 7 | 晚上 23:5x 打开首页看一眼今日星语,停在「星盘」页过零点后点「新建对话」 | 回首页不放加载环;今日星语卡先显示「今天的星语还没写出来。」或新一天的内容,随后换成新一天的内容,不显示前一天那句 |
|
||||
| 8 | 在星盘档案顶栏把当前人物换成他人,再点「新建对话」 | 不放加载环(若本次放了一次,记下来,不算未通过——换人会重载列表,允许回冷启动);新对话标题旁是那个人的名字;今日星语按那个人重取 |
|
||||
| 9 | 首页发一个问题,回答还在生成时点「星盘」,再点侧栏里这条对话回来 | 不放加载环;回答继续恢复(出现停止按钮或「回答仍在后台生成,正在自动恢复。」),最终回答完整出现 |
|
||||
| 10 | 同步骤 9,但回来时点「新建对话」 | 停在新对话;旧回答在后台继续,回到那条对话能看到完整回答 |
|
||||
|
||||
## 边界
|
||||
|
||||
- 暖返回只在「这次打开网页已经完整进过一次首页」时成立。直接从 `/chart` 打开网页、再点「新建对话」,首页会放一次加载环,这是预期(这次打开的第一次揭幕)。
|
||||
- 真实模型回复(步骤 9、10 的回答内容)需要模型凭据;只看恢复链路即可,回复质量不在本单。
|
||||
Reference in New Issue
Block a user