fix(home): one new-chat intent and a scoped login-return stash (BUG-1038)

Coming back to / from /people could show the previous rectification session
as a locked page: its title in the header, the composer stuck on
"正在打开生时校正…", and the new-chat greeting in the middle.

The state that survived between pages is the sessionStorage login-return
stash that secondary-page sidebar links write from the current ?c=:
- /people「和 TA 对话」used a second intent (?newChat=1) parsed by a
  component mounted inside Home after bootstrap, so the bootstrap new-chat
  branch never ran and the stash won.
- A stash id not in the current person's loaded list was looked up and
  landed with urlAction "keep", which assumes ?c= is already in the address
  bar. It was not, so the rectification auto-open never fired. The stash
  also ignored which person was current.
- An in-page new chat left the stash in place.

Fix: delete NewChatDeepLink / ?newChat and route「和 TA 对话」through
newChatHref(); a looked-up stash writes ?c= back (replace-selected) and is
dropped when it belongs to another person; startNewChat and
openChatBoundToProfile clear the stash. ?c= deep links, BUG-989 and BUG-705
are unchanged.

Tests: new real-lifecycle suite mounting the real Home, sidebar and people
page (10 cases: four secondary pages + mobile drawer, 和 TA 对话 for self and
another person, out-of-scope stash, same-person stash beyond the first page,
in-page new chat), plus two contract/unit tests. Six fail on origin/staging,
all pass here. Full suite 3928 / 61 failing, failure names identical to the
0ab061b9 baseline (3916 / 61).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
This commit is contained in:
Jesse_Chen
2026-09-26 07:23:50 +08:00
co-authored by Claude Opus 5.5
parent f4b8f26e15
commit 0a8350cc01
19 changed files with 765 additions and 24 deletions
+7
View File
@@ -1,5 +1,12 @@
# BLOCKED
## TASK-new-chat-from-people:登录态真机、Node 22 与 DB 待验(2026-09-26)
- 无受控登录账号:修复只在本地 `next start` + Chrome 151 上验过(CDP 拦截 `/api/*` 返回虚构账户、会话与人物,未提交脚本)。iPhone Safari 真机、真实 staging 数据按 `docs/testing/secondary-new-chat-20260923.md` 追加节 A1–A6 待产品走。
- 产品描述的入口(`/people` 点侧栏「新建对话」)本机未复现;复现且与截图逐项一致的入口是「在档案页换成他人后经不带新建意图的 `/` 回首页」和「对本人点和 TA 对话」。需产品真机确认当时的点击路径。
- 本机只有 Node v20.19.2:`mock.module` 类测试失败(基线 61 条);全量失败名单与基线逐条一致,Linux Node 22 全量待协调方复跑。无 Docker,`npm run test:db` 未跑(本单不动表)。
- 未部署;BUG-1038 保持 investigating。
## TASK-people-ephemeris-ui:登录态真机与 Node 22 全量待验(2026-09-26)
- 本机只有 Node v20.19.2:`mock.module` 类测试以 ERR_MODULE_NOT_FOUND 失败(基线即 61 条)。本轮全量 3915 条,失败 61 条,与基线测试名逐条一致、新增失败 0、无消失测试名;Linux Node 22 全量待协调方复跑。