- D2 resumable hint becomes「上次那次校正还没完成,可以在历史对话里接着做。」 so it does not imply the homepage pill resumes (it always creates). - The click-time non-self error in useRectificationSurface is the same user-visible sentence as the homepage hint; add the full stop. - Source, test, VOICE, DESIGN, CHANGELOG, BUG-1041, testing list and PROGRESS (amendment by Claude) updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017eEAG8HD3mm8gsKXgk8uU8
74 lines
8.1 KiB
Markdown
74 lines
8.1 KiB
Markdown
# PROGRESS · 首页开场小字拆分 + 今日星语 / 点数图标(2026-09-26)
|
||
|
||
任务书:`TASK-starter-home-polish-20260926.md`。执行方:Claude 子代理(直接执行模式)。分支 `codex/starter-home-polish-20260926`,worktree `.worktrees/starter-home-polish-20260926`,本地提交未推送。
|
||
|
||
## 基线
|
||
|
||
- `origin/staging` = `7475eb6e`(BUG-1038、BUG-1040 已合入)。
|
||
- 基线全量前端测试(Node 20.19.2):3953 条,pass 3865 / fail 61 / skipped 27(61 条均为环境缺口:Node 20 `mock.module` 的 `ERR_MODULE_NOT_FOUND @/…`、无 Docker)。
|
||
- 基线 `next build --webpack`:`/` ○ Static;rootMainFiles gzip 130933 B;`index.html` 引用的全部 js/css gzip 合计 656646 B。
|
||
- BUG 编号:开工时 `docs/BUG_HISTORY.md` 最大 BUG-1040,远端各分支无更大号 → 本单用 BUG-1041。
|
||
|
||
## 改动
|
||
|
||
| 任务 | 文件 | 内容 |
|
||
| --- | --- | --- |
|
||
| T1 / D1 | `components/starter-home.tsx`、`app/(app)/page.tsx`、`globals.css` | `StarterGreeting` 加可选 `dailyTrend` / `dailyTrendSettled`,渲染 `.starter-greeting-sub`(`--color-ink-secondary`、`--type-body-sm`、两行截断)。`page.tsx` 传 `natalMinuteAvailable ? dailyStarlanguageTrend : null`,读的就是 BUG-1040 暖快照初始化的同一个 `dailyStarlanguage` state;未就绪沿用静态句「今天的星语还没写出来。」+ `role="status"`,无 `aria-busy`、无新等待态。 |
|
||
| T2 / D2 | `components/starter-home.tsx` | 新增纯函数 `rectificationEntryHint(forSelf, summary)`:非本人 →「生时校正暂时只支持本人。」;`summary.hasResumableCase` →「上次那次校正还没完成,可以在历史对话里接着做。」(任务书修订后文案,见下);其余 `null`,不渲染 `<p>`。删「不确定出生时间时…」「上次已经校正完…」「未完成的那次可以从左侧继续」「看看今天的整体节奏」四句与「·」拼接。`StarterEntries` 去掉不再用的 `dailyStarlanguage` / `dailyStarlanguageTrend` / `rectificationCardAction` 三个 prop。 |
|
||
| T2 / 分支误判 | `lib/rectification-entry.ts` | **真 bug(BUG-1041)**:`/api/rectification/cases/entry-summary` 返回 camelCase(`getRectificationEntrySummary` 的投影),`entrySummaryFromResponse` 只读 snake_case,每个真实响应都解析成全 false。改为优先读 camelCase、仍兼容 snake_case。结果:已校正账户可访问名变回「再次校正」,未完成提示能出现。 |
|
||
| T2 / D4 | — | 边界句「出生时间不足以支持的判断我会说明,不会补造具体分钟。」原位保留。 |
|
||
| T3 / D3 | `components/starter-home.tsx`、`app/(app)/page.tsx` | 今日星语入口 `Sparkles` → `MoonStar`;右上角点数 `Sparkles` → `Coins`(`className="credit-icon"`、`aria-hidden`、按钮 `aria-label` 不变)。已确认 lucide-react 1.24.0 同时导出 `MoonStar`、`Coins`。 |
|
||
| T4 | `CHANGELOG.md`、`frontend/DESIGN.md`(Starter home + §9)、`frontend/docs/VOICE.md`、`docs/BUG_HISTORY.md`(BUG-1041, investigating)、`docs/testing/starter-home-polish-20260926.md`、`docs/tasks/README.md` | 记录。 |
|
||
|
||
红线核对:`Home()` 未新增 hook(只改 JSX 表达式);`page.tsx` 1373 → 1370 行;无语句压行;未改今日星语接口与生成逻辑;未改依赖、迁移、workflow。
|
||
|
||
## 测试
|
||
|
||
| 项 | 结果 |
|
||
| --- | --- |
|
||
| `tsc --noEmit` | 0 错 |
|
||
| `npm run lint` | 0 error(126 warning,均为既有文件的既有 warning,本单文件无新增) |
|
||
| 全量 `npm test` | 3960 条,pass 3872 / fail 61 / skipped 27 |
|
||
| 失败名单 vs 基线 | 逐条一致(`diff` 为空),新增失败 0 |
|
||
| 测试名单 vs 基线 | +7 条新名(下文),消失 0 条 |
|
||
| Python 源码合同 | `tests/test_daily_and_rectification_entrypoints.py`、`test_session_management_entrypoints.py`、`test_birth_time_journey_contract.py`、`test_supabase_user_data_contract.py` 全过 |
|
||
| `npm run build -- --webpack` | 通过;`/` ○ Static,`/chart` `/ephemeris` `/people` ○ |
|
||
| gzip | rootMainFiles 130933 → 130933 B(0);首屏引用全部 js/css 656646 → 656729 B(+83 B,+0.013%) |
|
||
|
||
新增 `frontend/tests/starter-home-polish-20260926.test.tsx`(7 条):D2 首次 / 已校正无提示、未完成一句;D2 非本人(纯函数 + 真实 subject store 渲染,按钮禁用);D4 边界句;D1 副行三态(就绪 / 静态句 + status / 无分钟不渲染);D1 page.tsx 读暖快照同源 state;D3 图标与可访问名;BUG-1041 路由输出 JSON 往返后解析(修复前此条失败,已实测)。
|
||
|
||
### 改动既有断言(三栏同时写在测试文件内)
|
||
|
||
| 文件 | 原值 | 新值 | 原因 |
|
||
| --- | --- | --- | --- |
|
||
| `frontend/tests/icon-motion-audit.test.ts` | `import { Clock3, Sparkles }`、`<Sparkles aria-hidden="true" />`、doesNotMatch `/Moon\|MoonStar\|thinking-orbs/` | `import { Clock3, MoonStar }`、`<MoonStar aria-hidden="true" />`、doesNotMatch `/Sparkles\|thinking-orbs/` | D3 产品拍板换 MoonStar;「无循环动画、无 thinking-orbs」原样保留,并反向锁住旧图标 |
|
||
| `frontend/tests/rectification-agentic-entry.test.ts` | match `/rectificationCardAction === "restart"/` | match `rectificationEntryHint(rectificationForSelf, rectificationEntrySummary)` 与 `summary?.hasResumableCase`;doesNotMatch `=== "restart"` | D2 删掉 restart 那句;BUG-1041 查明该分支从未命中。「由服务端 entry summary 驱动、不读会话列表」的意图不变 |
|
||
|
||
## 浏览器验证(本地 `next start` + Chrome 151 headless,CDP 拦截 `/api/*` 回放虚构数据,entry-summary 用路由真实的 camelCase 形状)
|
||
|
||
| 场景 | 副行 | 入口下方 | 其他 |
|
||
| --- | --- | --- | --- |
|
||
| 375 / 1280 × 明 / 暗,已校正账户 | 趋势句两行,明 `rgb(95,95,89)` / 暗 `rgb(179,175,164)`,14px | 无 | 生时校正可访问名「再次校正」;图标 moon-star / coins;无横向溢出 |
|
||
| 375 明,未完成校正 | 趋势句 | 「上次那次校正还没完成,可以接着做。」(截图为修订前文案) | 可访问名「开始新的生时校正」 |
|
||
| 375 明,首次 | 趋势句 | 无 | — |
|
||
| 1280 明,今日星语 unavailable | 「今天的星语还没写出来。」`role="status"` | 无 | — |
|
||
| 375 明,无出生分钟 | 不渲染 | 仅边界句 | 入口「查看今日运势」 |
|
||
| 暖返回:首页 → /chart → 新建对话(今日星语接口压 2.5 s) | 首帧即有趋势句(点击后 17–20 ms) | — | 可交互 23–27 ms,加载环 0 次;控制台 0 error |
|
||
|
||
截图(仓库内):`docs/testing/starter-home-polish-20260926/starter-375-light-resumable.png`、`starter-1280-dark.png`。其余截图在会话 scratchpad `shp/`(375/1280 明暗、静态句、无分钟、暖返回),未入库。
|
||
|
||
## 环境缺口
|
||
|
||
- 无登录态真机:真实账户的 entry-summary、真实今日星语文本长度、VoiceOver 朗读 → `docs/testing/starter-home-polish-20260926.md`。
|
||
- Node 20:61 条 `mock.module` 类失败为既有环境缺口,名单与基线一致。
|
||
- 无 Docker:DB 套件未跑(本单不动表)。
|
||
|
||
## 观察(未处理,留给产品 / Claude 定夺)
|
||
|
||
- ~~首页「生时校正」按钮走 `intent=homepage`,服务端总是新建 Case;未完成的那次要从侧栏继续,原文案「上次那次校正还没完成,可以接着做。」可能让用户以为点按钮就会接着做。~~ 已处理,见「任务书修订」。
|
||
|
||
## 任务书修订(Claude,2026-09-26)
|
||
|
||
- 任务书作者(Claude)采纳上面的观察,修订 D2 未完成提示为「上次那次校正还没完成,可以在历史对话里接着做。」:「历史对话」对桌面侧栏和手机抽屉都成立,不说「左侧」。源码、`starter-home-polish-20260926.test.tsx`、VOICE、DESIGN、CHANGELOG、BUG-1041、真机清单同步改。仓库内截图 `starter-375-light-resumable.png` 仍是修订前文案,未重拍。
|
||
- 同一修订:`useRectificationSurface.rectificationLimitedToSelf` 点击时的错误文案与首页非本人提示是同一句用户可见文案(经 `rectificationErrorMessage` 显示在入口下方的 `form-error`),补句号为「生时校正暂时只支持本人。」。无测试断言该字符串。
|