[#903] Illegal draft: named error + recovery; hydration skeleton - #1065
Merged
Merged
Conversation
`/new-session?draftId=…` 的两个非 happy-path 此前都是「什么都不显示」:
`<Show when={tabs.ready()}>` 无 fallback ⇒ 水合完成前空白页;找不到 draft 时
`fallback={<Navigate href="/" />}` ⇒ 静默弹回首页、零提示。REQ-085(#201)AC2
点名禁止的正是这两项。
改法(最小面):守卫本体抽成 `packages/app/src/pages/draft-route-gate.tsx` ——
零上下文依赖(不 useLanguage/不 useNavigate/不碰 `@/*` 别名),文案与恢复动作
由 `createDraftRoute` 注入。于是 ui-mac 的真组件 lane 能直接挂载它、断真 DOM,
判据断的是渲染结果而不是源码文本(ADR-037 决策 4)。
- 水合中:`DraftRoutePending` 骨架 + role=status/aria-busy/aria-label。
- 缺失/已删除/非法 draftId:`DraftRouteMissing` 具名错误(role=alert)+ 一个
「返回首页」按钮;守卫**自己不导航** —— 静默跳转正是本票要修掉的行为。
- 文案走 app i18n(en + zh;其余 locale 按上游既有机制回落英文,该包 parity
在 pin 849c259 上本就红且被上游 skipIf(CI) 治住,本次未加重也未修复它)。
- happy path(打开草稿 / promoteDraft 升级 / 关掉当前草稿页)一字节未变:
两条路径在 tabs.tsx 里都把「改 store」与「导航」放在同一个 startTransition
里,不会闪过缺失态。
判据(#903 退出条件,反向验证已实跑):
`test-component/draft-route-gate.cases.ts`(5 条,子进程,真挂载生产模块)+
宿主 `src/renderer/alpha-ui/draft-route-gate.component.test.ts`,并登记进
`scripts/gate-files.tsv`。三次反向:①摘掉 ready 的 fallback ⇒ hydrating 组红;
②摘掉 missing 的 fallback ⇒ missing 组红;③把文案写死并在 fallback 里自动
调 onRecover(等价于旧的静默 Navigate)⇒ missing 组红。
app.tsx 的接线另有一条 seam-contract 减速带(源码锚,非闸门),因为 app.tsx
结构上进不了 bun。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FuY4ooo93aqZcCQy6abbhM
jinjunnn
marked this pull request as ready for review
August 22, 2026 05:39
This was referenced Sep 17, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Illegal draft routes get a named error + recovery action; hydration shows a skeleton instead of a blank page.
Fixes #903
Test plan
Made with Cursor