f62977f2c0
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LVapmh2oGNyr6ECHKjPJY8
26 lines
2.3 KiB
Markdown
26 lines
2.3 KiB
Markdown
# 任务书 · 拆分首页巨石组件·第三批:onboarding/profile 与校正胶水(2026-09-01)
|
||
|
||
基线:`origin/staging` 最新(不早于 `551d6317`)。第一、二批(`54269fcf`、`551d6317`)的全部红线与样板原样适用,本任务书只写增量。与其它改 `page.tsx` 的轮次不得并行——**注意 staging 上有另一条工作流在推报告/语气类改动,开工前 `git log origin/staging` 确认没有未验收的 page.tsx 改动,有就停下登记 `BLOCKED.md`。**
|
||
|
||
## 范围(行号基于 `551d6317`,按符号定位)
|
||
|
||
沿用第二批验收确认的模式:**hook 内部 0 个 useState/useRef/useEffect,一切经显式参数传入/返回**。这个模式已两轮公证(hook 顺序风险为零),不要回退到"独占 state 下移"。
|
||
|
||
### 任务 1 · profile/onboarding/账户簇 → `hooks/use-profile-onboarding.ts`
|
||
|
||
`refreshAccount`(1307)到 `signOut`(1569–1582)共约 275 行:`openAccountDialog` / `closeAccountDialog` / `persistAvatar` / `persistProfile` / `assessSavedBirthTime` / `saveProfile` / `saveOnboardingName` / `saveOnboardingBirth` / `editDeclaredBirthTimeDetails` / `saveOnboardingPlace` / `completeGuidedBirthTime` / `retryBirthTimeAssessment` / `signOut`。
|
||
|
||
### 任务 2 · 校正胶水簇 → `hooks/use-rectification-surface.ts`
|
||
|
||
`refreshRectificationEntrySummary`(1634)到 `handleRectificationMessagesChange`(1813–1821)共约 190 行。与 `use-consultation-run` / `use-session-management` 的依赖方向必须单一(经 Home 传递,不互相 import)。
|
||
|
||
### 任务 3 · 读取面与度量
|
||
|
||
`tests/home-surface.ts` 与 Python `_home_surface()` 扩容;受影响测试"断言不变、只换读取面",逐条登记。度量表同前两批口径。**目标:`page.tsx` ≤ 2,000 行**(2,445 − 约 465),不达标写明原因。
|
||
|
||
starter 入口三函数(1583–1633)、合盘起草(1822 起)、composer 小函数(1899 起)**本批不动**——剩的都是小而散的胶水,拆到这里收益已尽,第三批是收官批。
|
||
|
||
## 验收
|
||
|
||
同前两批:tsc、测试基线(开工时实测 `origin/staging`,fail=0/skipped=0 于 Docker 环境,无 Docker 逐条比对既有缺口)、`/` 保持 `○ Static`、首屏 gzip ±2%、纯搬家 md5 抽样自证写进 PROGRESS(至少 4 个函数)、quick gate 4 个前端契约 Python 文件保持全绿。
|