Files
Jyotisha/docs/testing/secondary-new-chat-20260923.md
T
Jesse_ChenandClaude Opus 5.5 0a8350cc01 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
2026-09-26 07:23:50 +08:00

48 lines
5.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 次级页「新建对话」真人验收(2026-09-23)
关联:`TASK-secondary-new-chat-intent-20260923.md`、BUG-1015。
## 前置与记录边界
- 本清单尚未执行,不以源码合同或纯函数测试代替真实登录走查。
- 在本轮修复已部署的 staging 使用受控测试账号;先核对 `/api/health` 的部署提交。不借用任何他人的登录态。
- 使用明确虚构的资料与对话。测试账号至少有一条已保存的普通咨询;记录列表项数量,不记录账号、会话 ID、出生信息或完整请求体。
- 用浏览器网络面板核对请求方法和路径即可,不保存 Cookie、JWT 或请求正文。每个场景记录通过/未通过、浏览器、日期和脱敏现象。
## 必验
| 步骤 | 操作 | 预期 |
| --- | --- | --- |
| 1 | 从已有普通咨询进入 `/chart`,点侧栏「新建对话」 | 首页为空会话,不显示旧消息;地址为 `/`,无 `new`、无 `c`;历史列表不增加;没有创建会话的 `POST /api/sessions`,无“该对话不存在或已被删除”提示 |
| 2 | 在步骤 1 的空会话发送第一问 | 走既有创建流程;成功后地址为 `/?c=<新会话>`,历史顶部出现新会话;输入与回复正常 |
| 3 | 重做步骤 1,不发消息,直接刷新 | 按无参数首页的既有规则恢复会话,不再次执行新建意图;不是继续保留上一步未保存空会话。无收藏/存根干扰时回最近普通咨询(D6) |
| 4 | 在 `/ephemeris`、`/reports`、`/reports/<受控测试报告>` 分别重复步骤 1 | 与步骤 1 一致 |
| 5 | 移动端打开次级页抽屉,点「新建对话」 | 与步骤 1 一致,抽屉关闭;没有新入口、额外等待动画 |
| 6 | 已有登录返回存根时,访问 `/?new=1&c=<已有会话>`;另测 c 为格式错误值 | 新建意图胜出,打开空咨询;清除两种参数及存根;不恢复旧会话,不提示会话缺失 |
| 7 | 次级页点击账户页脚返回 `/`;首页点击自己的「新建对话」 | 页脚仍走原回首页规则;首页按钮仍走原本地新建流程 |
| 8 | 单独访问有效 `/?c=<已有会话>`(不带 new),并浏览器后退/前进 | 深链仍打开指定会话;没有被本次新建规则抢走;URL 历史仍按原设计工作 |
| 9 | 在旧咨询仍后台生成时进入次级页,再点「新建对话」 | 仍停留新空咨询;旧任务继续恢复但不抢回活动会话,启动恢复提示不留在空会话上;无 `new` 正常回首页时仍恢复旧咨询 |
## 边界复核
- 刚注册、没有历史的受控账号进入新建入口仍只有一个可见空会话,首问前不写数据库、不显示空列表行。启动内部已有的空列表兜底与本单新建分支可能分别产生本地空对象;两者都必须隐藏且不持久化。
- 普通刷新 `/` 不承诺“始终空白”,本单不更改默认落点规则。
- 需要模型凭据才能完成步骤 2 的真实回复;若不可用,只记录创建链的实际证据,将回复部分标环境缺口,不伪写通过。
## 追加:先开一条生时校正再从档案页回首页(BUG-1038,2026-09-26)
关联:`TASK-new-chat-from-people-20260926.md`、`PROGRESS-new-chat-from-people-20260926.md`。本节尚未执行;本机只用虚构数据在本地 `next start` 上验过,截图见 `new-chat-from-people-20260926-before.png`(修复前)、`-after.png`、`-after-talk.png`(修复后)。
前置:受控测试账号至少有一条生时校正会话、一条普通咨询,星盘档案里至少有一个他人。每步先从侧栏打开那条生时校正会话,确认校正界面已打开(地址带 `?c=`),再点侧栏「星盘档案」进入 `/people`。
| 步骤 | 操作 | 预期 |
| --- | --- | --- |
| A1 | 在 `/people` 点侧栏「新建对话」(桌面,和 iPhone 抽屉各一次) | 首页标题「新对话」,输入框占位「想聊什么都可以」且可输入,发送可用;不出现「正在打开生时校正…」;地址为 `/`;侧栏那条校正会话不显示「正在打开」 |
| A2 | 在 `/people` 选中本人,点「和 TA 对话」 | 同 A1;等 5 秒,页面不从新对话翻回校正界面,地址里没有 `c=` |
| A3 | 在 `/people` 选中一个他人,点「和 TA 对话」 | 同 A1;标题「新对话」旁边是这个人的名字 |
| A4 | 在 `/people` 选中一个他人,点「看星盘」,到 `/chart` 后点左下角账户(回首页) | 落在这个人的新对话:标题「新对话」旁是这个人的名字,输入框可用;不出现旧校正标题和「正在打开生时校正…」(修复前就是这个画面) |
| A5 | 从校正会话点侧栏「星盘」,直接点左下角账户回首页(当前人物仍是本人) | 按原规则回到那条校正会话并打开校正界面,地址带 `?c=`;不停在锁住的输入框 |
| A6 | 首页点自己的「新建对话」,再进 `/chart`,点左下角账户回首页 | 不回到更早的校正会话 |
记录:每步通过 / 未通过、设备与浏览器、日期、脱敏现象;不记录账号、会话 ID、出生资料。