Rename, delete with confirmation, pin, share and reorder moved from Home's session hook into the shared (app) shell, so /chart, /ephemeris, /reports and /people rows get the same menu and drag as /. Home only adds its paging cursor, what the open conversation does when deleted, and which local chats are unsaved. BUG-1467. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Ad9rqAB8pXXvyzh7f4X8v
2.3 KiB
2.3 KiB
进度 · 侧栏会话菜单搬进共用外壳(issue #116)
- 执行方:Claude 直接执行(产品 2026-10-27 指定;issue #114 讨论选 A)
- 分支:
codex/session-shell-116-20261027,基线origin/staging36fd4b2c8 - Bug:BUG-1467(BUG-1466 的后续)
做了什么
hooks/use-shell-session-actions.ts:重命名、删除(确认 + 乐观删除 + 失败回滚)、收藏、转发、排序、翻页兜底,由(app)/layout.tsx调用,改共用 store。components/session-delete-dialog.tsx:删除确认框从首页搬到外壳,文案不变。session-store:加sessionMenuId、pendingSessionDeletion。- 首页
use-session-management.ts删掉这五项和两份状态,只留onSessionDeleted(清校正授权、删当前会话时跳下一条)与isSessionSaved;use-home-shell-registration.ts经sessionHooks发布翻页游标和这两项,均为稳定包装。 AppSidebar:sessionControls拆成独立入参;onOpenSession在非首页把行导向/?c=<id>。- 外壳兜底列表按
sortSessions排序。
验收(本机)
| 项 | 结果 |
|---|---|
| tsc | 0 错 |
| lint | 0 error;警告数与基线一致(改动文件里多出的一条已清掉) |
| 前端全量 | 5262 条;失败 28 条,全部在基线 29 条之内(DB / 部署套件,无 Docker);无测试名消失,新增 3 条 |
| Python 快速门 | 通过(临时环境;字体切片测试需补装 brotli,属环境) |
next build |
/ 仍 Static |
| 首屏 gzip | 679693 → 681714(+0.30%);同一脚本量基线和新版 |
| 首页 useState / useRef | 未增加(home-shell-growth-contract 通过) |
改动的既有断言
三栏说明都写在测试文件里:chat-session-url.test.ts(删除跳下一条)、order-batch.test.ts(读新文件)、home-sidebar-rerender.test.tsx(重命名改为翻页验证稳定包装)、session-list-lifecycle.test.tsx(入参)。home-surface.ts、tests/test_session_management_entrypoints.py、tests/test_supabase_user_data_contract.py 的首页文件清单加上两个新文件。
环境缺口
- 无登录态浏览器:真机清单见
docs/testing/session-shell-116-20261028.md。 - 本机工作区与
.venv曾被其他会话清理腾盘,重建后验收;不影响结果。