Files
Jyotisha/docs/tasks/PROGRESS-settings-dialog-and-billing-pane-20260906.md
T

90 lines
8.2 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.
# PROGRESS · 设置弹窗重排与账户与点数入弹窗(2026-09-06)
工作树:`.worktrees/settings-dialog-and-billing-pane-20260906`
分支:`codex/settings-dialog-and-billing-pane-20260906`
基线:任务书写 `origin/staging` @ `985c3258`;开工时 `origin/staging` 已到 `9ce7a374`(含 composer 与会话列表),以当时远端为准。
`page.tsx` 开工 **2035** 行,收尾 **1976** 行(净减 59,上限 1995)。未改迁移、未 bump Skill、未改支付 API。
| 任务 | 状态 | BUG |
| --- | --- | --- |
| 5.1 弹窗壳固定尺寸 + 四分区 | 完成 | BUG-554 |
| 5.2 个人资料搬出 `page.tsx` | 完成 | — |
| 5.4 账户与点数入弹窗,删除 `/membership` | 完成 | BUG-554 |
| 5.3 星盘资料列表→详情 | 完成 | BUG-554 |
| 5.5 BUG_HISTORY / CHANGELOG / DESIGN / VOICE | 完成 | — |
## 实现要点
- `.settings-modal`:桌面 `width: min(100vw - 32px, 880px); height: min(84dvh, 640px)`;四分区共用;退出仍是 400px `logout-modal`
- `AccountDialog` 增加 `"billing"`。导航顺序:个人资料 → 星盘资料 → 账户与点数 → 通用设置。
- `profile-panel.tsx`:48px 头像一行;删除「管理星盘资料」。
- `chart-library-panel.tsx`:内部视图 `list | self | other | add`;列表条可点 + chevron;合盘操作只在其他人详情。
- `billing-panel.tsx` + `use-billing-panel.ts``next/dynamic` `{ ssr: false }`。页签含订单;兑换码行内表单。无 spinner / 「正在加载」。
- 删除 `frontend/src/app/membership/page.tsx``orders/page.tsx``next.config.ts` 临时重定向到 `/?settings=billing`
- `settings-url.ts` 在 hydrate / popstate 解析后 `history.replaceState` 抹掉参数;`/` 不用 `useSearchParams`
- 七处入口改为 `openAccountDialog("billing", { source, plan, tab })`。生时校正 402 不再 `window.location.assign`
## 既有断言改动
| 文件 | 原值 | 新值 | 原因 |
| --- | --- | --- | --- |
| `account-dialog-overlay` | `openRedeem``profile-modal` / `chart-library-modal` | `renderBilling`;四导航;`.settings-modal` 同时有 width 与 height | 5.1 固定尺寸四分区 |
| `page.tsx` `renderProfile` | 约 50 行 JSX + 「管理星盘资料」 | `<ProfilePanel />`,头像 48px | 5.2 净减行;去掉重复入口 |
| `chart-library-panel` | 无条件 `<form``setEditingSelfChart(true)` | 列表默认;`setView({ kind: "add" })` 后才出表单 | 决策 4 |
| 本人详情标题 | 编辑本人资料 | 编辑本人星盘 | 详情视图文案 |
| 合盘 pending 文案 | `synastryPendingId === record.id` | `selectedOther.id` | 操作只在详情 |
| `membership-page` 26 条支付/兑换/订单 | 读 `app/membership/page.tsx` | 读 `billing-panel.tsx` + `use-billing-panel.ts` | 页面删除 |
| 会员页存在 / Suspense / loading | 页面必须存在 | 页面不存在;无 spinner | 决策 6、8 |
| 兑换码 | `redeemOpen` 子弹窗 | `value="redeem"` 页签 | 决策 5 |
| `goBack` / `history.back` | 整页返回 | 无;`stripSettingsQuery` | 账单在首页 |
| 订单 | 独立页 + 「正在加载订单…」 | 页签 idle/ready/unavailable,无加载句 | AGENTS §6 |
| 页签「点数充值」 | 点数充值 | 点数包 | VOICE |
| 主标题「套餐与会员」 | `<h1 className="membership-title">` | 弹窗标题「账户与点数」+ `billing-summary` | 不再是整页 |
| `.membership-page` / `.membership-shell` / `.membership-hero` | 整页壳 CSS | 删除;卡片/页签 CSS 保留 | 只删整页 chrome |
| `membershipHref` | `/membership?source=` | `/?settings=billing&source=` | 深链接 |
| `chat-navigation` 4 条软跳 | `router.push(membershipHref(...))` | `openAccountDialog("billing", { source })` | 决策 7 |
| 校正 402 | `window.location.assign(membershipHref("rectification"))` | `onOpenBilling({ source: "rectification" })` | 硬跳转清单缩小 1 |
| 会员 401 | membership 页 3 次 + 订单页 1 次 | billing hook 4 次 `assign("/login")` | 认证仍硬跳 |
| `test_api_server_security` `app_routes` | 含 `membership``membership/orders` | 去掉这两条 | BUG-143 路由集合 |
| 付费墙 | `<Link href={membershipHref("onboarding-paywall")}>` | `onOpenBilling` 按钮 | 关掉墙后打开 billing |
| `beam-avatar` | 头像编辑 JSX 在 `page.tsx` | 读 `profile-panel.tsx``page.tsx` 只挂 `ProfilePanel` | 5.2 搬出 |
| `knownUnstyled` | 允许 `membership-orders` / `membership-segment` | 从白名单删除 | 整页删除后不再渲染 |
`git grep -n "/membership" frontend/src` 还会命中 `@/lib/membership` 模块 import,不是路由。路由字符串只出现在 `next.config.ts` 重定向。
## 测试
| 命令 | 结果 |
| --- | --- |
| 任务书收尾 tsx 合同(overlay / chart-library / membership / billing / settings-url / profile-panel / chat-navigation / epay / redeem-orders / starter / settings-mvp / consultation / rectification-surface | **168 pass / 0 fail** |
| `beam-avatar` + `class-name-definition-contract` + `profile-panel` | **10 pass / 0 fail** |
| `./node_modules/.bin/tsc --noEmit` | 0 错 |
| 改动文件 `eslint --quiet``npm run lint` | **0 error**(全仓 79 条既有 warning |
| `page.tsx` | 1976 行(开工 2035,净减 59 |
| `/opt/anaconda3/bin/python3.12 -m pytest tests/test_api_server_security.py -k capability_audit` | 2 passed |
| `npm run build -- --webpack` | `/``○` Static;产物无 `/membership` 页面;`routes-manifest` 有两条 307 重定向。首页 `page-*.js` gzip **181103** 字节;账单文案在按需 chunk `773.*.js`gzip **4994**),未打进首屏合同路径。 |
| 默认 `npm run build`Turbopack | 本工作树 `frontend/node_modules` 是指向主仓的 symlinkTurbopack 报 `points out of the filesystem root`。验收用 webpack 构建。 |
| `npm test` 全量 | 产品合同已绿。其余失败均走 `startPostgresFixture` / `docker compose up postgres`,本机 compose 起不来,与本单无关。 |
Next.js 16 typed routes 不允许 `route.ts` 额外 export。`dossierResponse` 去掉 `export`(仍只给同文件 GET 用),否则 `next build --webpack` 的生成类型检查失败。不是产品改动。
分支相对当前 `origin/staging` 落后 2 个提交(BUG-555/556)。未在脏树上合并,避免和本单的 `CHANGELOG` / `BUG_HISTORY` 撞车。
浏览器走查见 `docs/testing/settings-dialog-and-billing-pane-20260906.md`。本机未起登录会话,真实四分区切换留给 staging 验收。
## 验收(Claude2026-09-06,对照 `TASK-settings-dialog-and-billing-pane-20260906.md`
共用门禁见 `PROGRESS-session-list-title-and-order-20260906.md` 验收段(`e2f4b55c`tsc 0 错、lint 0 error、2770 项测试 29 条环境失败、`next build` `/` Static、首屏 gzip +0.61%)。
| 项 | 结论 | 依据 |
| --- | --- | --- |
| 5.1 弹窗壳固定尺寸 + 四分区 | 通过 | `.settings-modal { width: min(100vw 32px, 880px); height: min(84dvh, 640px) }``chart-library-modal` / `profile-modal` 已无;导航 个人资料 → 星盘资料 → 账户与点数 → 通用设置 |
| 5.2 个人资料搬出 `page.tsx`,无「管理星盘资料」 | 通过 | `profile-panel.tsx``page.tsx` 2035 → 1976 行(净减 59 ≥ 40 |
| 5.3 星盘资料列表 → 详情 | 通过 | `chart-library-panel.tsx` 内部视图 `list / self / other / add`,默认列表,无无条件 `<form` |
| 5.4 「账户与点数」入弹窗;删 `/membership``/membership/orders`307 重定向;七处入口改回调;`/` 不用 `useSearchParams` 保持 Static | 通过 | `src/app/membership` 已删;`next.config.ts` 两条 `redirects``git grep "/membership" frontend/src` 只剩 `next.config.ts``settings-url.ts``window.location` 解析后 `replaceState` 抹参 |
| 5.4 测试迁移(26 条进 `billing-panel.test.ts`)、`settings-url.test.ts``chat-navigation-a11y` 三栏表、Python `app_routes` 去掉两条 | 通过 | 三栏表完整;`tests/test_api_server_security.py` 已去 `membership` / `membership/orders` |
| 5.5 BUG-554、CHANGELOG、DESIGN、VOICE | 通过 | — |
**结论:通过**。修复 SHA `dc6598d7`。四分区真实切换、移动端弹窗、`/membership` 深链回落留 `docs/testing/settings-dialog-and-billing-pane-20260906.md` 真人走查。