Root error/not-found pages lost all CSS after globals left the shared layout. Inline the same token fallbacks as global-error so admin stays off the chat stylesheet. Collapse three LoaderCircle spins into one InlineSpinner, and build greeting fixtures in local time so UTC CI does not hit the night-time copy. Co-authored-by: Cursor <cursoragent@cursor.com>
6.2 KiB
PROGRESS · 前端优化九条收尾(2026-08-29)
工作树:.worktrees/frontend-followup-20260829
分支:codex/frontend-followup-20260829
基线开工:origin/staging @ 31b54aa7(任务书写的 3198fb6b 之后已有 BUG-431;开工后远端又快进了 86d6923e 生时校正死锁修复)。交付前 rebase 到最新 origin/staging。
不要写成 PROGRESS.md。
任务 A · 根 404 / 错误页内联样式
error.tsx / not-found.tsx 改为与 global-error.tsx 相同的内联 style + fallback 色值(已核 globals.css :root:--color-canvas: #fbfaf7、--color-ink: #1d1d1f、--color-ink-secondary: #5f5f59、--color-border: #d8d6cf、--color-action: #85432f、--color-danger: #9a2f2f)。未 import site-styles / globals.css。
404 为保住 root-error-boundaries-contract 的 render={<Link href="/" />} 锁,用 cloneElement 套内联样式,不引入 Button。error.tsx 仍 "use client",console.error 未动;重试用原生 <button>。
BUG-433(远端 origin/staging 的 BUG-432 已被 86d6923e 生时校正死锁占用)。BLOCKED.md 已订正“必须另开布局链”那条。
构建产物
./node_modules/.bin/next build exit 0。路由:○ /、○ /_not-found、ƒ /login、ƒ /admin/**。
_not-found.html body:无 min-h-svh / text-muted-foreground / Tailwind 工具类;内联 background:var(--color-canvas, #fbfaf7);stylesheet 仅 3b67syn08d_z3.css(Inter @font-face,2146 B)。
admin CSS chunk:0o-8xwneekfl4.css(5547 B,message-list=0)+ 3b67syn08d_z3.css(2146 B)。含 .message-list 的 215584 B chunk 025-k_ikkkzbx.css 只出现在站点 index.html。
index.html stylesheets:
rel="stylesheet" href="/_next/static/chunks/3b67syn08d_z3.css"
rel="stylesheet" href="/_next/static/chunks/025-k_ikkkzbx.css"
rel="stylesheet" href="/_next/static/chunks/23pfyi_fov2fp.css"
浏览器(next start -p 3011,路径 /this-path-does-not-exist)
居中暖白页,不是裸 HTML。计算样式:background rgb(251, 250, 247)、color rgb(29, 29, 31)、display:flex + 居中、链接 min-height:44px / min-width:88px。页面 stylesheet 只有 Inter chunk + 内联 <style>(无 216 KB globals)。文案:404 / 页面不存在 / 返回对话。
任务 B · 时区夹具
onboarding-presentation.test.ts 的 noon/8 点改为 new Date(2026, 6, 19, hour)。期望文案未改。+08:00 且断言时段文案的同类已清零。
TZ=UTC pass 3 fail 0
TZ=Asia/Shanghai pass 3 fail 0
TZ=America/New_York pass 3 fail 0
任务 C · readonly 夹具
rectification-answer-choice.test.ts 不再 Object.assign:candidateSnapshotFixture({ decisionReceipt }) 一次构造;dossier 用展开重建。未改断言、未改 src/** 类型、无 as any / @ts-ignore。
rectification-v10-conversation-focus.test.ts:403 仍有 Object.assign(snapshot.decision_receipt, …),不是上一轮那两处、且只改 receipt 字段;本轮未动,避免扩大夹具面。
任务 D · 行内等待合一
| 等待 | 归类 | keyframes | 时长 |
|---|---|---|---|
| 载入账户 / 准备问题 / 生时评估浮层 | 整块阻塞 | app-loading-orbit |
1.4s linear |
| 出生地 / 时间线 live / 个人报告列表与详情 / 报告 loading | 行内 | inline-spin(InlineSpinner) |
0.8s linear |
| 引导打字 / Agent 微光 | 流式生成 | onboarding-caret / agent-activity-shimmer |
700ms steps / 1.6s linear |
| 今日星语首次拉取 | 行内,静态占位 | 无 | — |
删了 birth-place-spin、consultation-run-spin、死代码 @keyframes pulse、daily-starlanguage-pending。animate-spin 在 frontend/src 为 0。@keyframes 从 13 降到 11。consultation-run-timeline.tsx 仍保留 LoaderCircle 标识(既有源码锁),画面用 InlineSpinner。
今日星语不用 spinner:形态是一段文案卡,不是“局部操作在转”;呼吸会在轨道环之后再换一套动效,所以首次拉取改为静态「正在写下今天的星语。」(aria-busy 仍在)。
frontend/DESIGN.md 新增 §9「等待与加载」。
初始化按帧(代码路径;本环境无受控新账号,未录完整注册)
- 轨道环「正在载入账户」(整块阻塞)
- 新账号填姓名 / 出生资料。出生地解析若触发,行内
InlineSpinner出现在状态行(role="status"保留) - 资料齐后轨道环「正在准备问题」;若引导语还在流式,同时有打字光标(流式类,不是等待类)
- 落到首页:今日星语显示静态「正在写下今天的星语。」,无呼吸、无 spinner
- 拉取完成:卡片换成终态文案,无动效切换
用户在初始化结束那一刻看到的等待形态:轨道环结束 → 静态占位(0 套新动效)。不再出现「环 → 呼吸」换装。
reduced-motion:轨道环被全局 * 收成一帧(未改 AppLoadingIndicator DOM);InlineSpinner animation: none,收成 8px 实心圆点,旁边文案仍在。无停住的半圈圆弧。
出生地 / 时间线 live / 个人报告三处均是同一套 inline-spin 圆环(尺寸 14 / 12 / 14–32)。
验收命令
./node_modules/.bin/tsc --noEmit(不要 npx tsc)、eslint 0 error、tsx --test tests/*.test.ts、next build。
第一次全量测试在 PATH 以 /usr/bin 开头时,staging-backend-workflows 用系统 Python 缺 PyYAML 红了 1 条(2207 tests,pass 2206,fail 1,skipped 0)。未改该测试。第三次用 Homebrew Python(PyYAML 6.0.3)独占跑通。
./node_modules/.bin/tsc --noEmit
exit 0,无输出。
./node_modules/.bin/eslint --max-warnings=999
23 problems(0 errors, 23 warnings)。本轮改动文件单独再跑:0 problem。未去修仓库里既有 unused-vars。
./node_modules/.bin/tsx --test tests/*.test.ts
ℹ tests 2207
ℹ pass 2207
ℹ fail 0
ℹ skipped 0
ℹ duration_ms 419209.931625
exit 0
≥2205,skipped=0。
./node_modules/.bin/next build
exit 0。Next.js 16.3.1。○ /、○ /_not-found、ƒ /login、ƒ /admin 及全部 /admin/**。
个人报告中心 /reports 加载态可见 InlineSpinner 圆环 +「正在读取报告…」(role="status")。