Files
Genarrative/docs/technical/PUBLIC_WORK_DETAIL_NOT_FOUND_RECOVERY_2026-05-11.md
kdletters 54968701f0
Some checks failed
CI / verify (push) Has been cancelled
fix public work detail not found recovery
2026-05-11 19:52:25 +08:00

1.8 KiB

公开作品详情失效回首页修复

日期:2026-05-11

背景

直接访问 /works/detail?work=<公开作品号> 时,如果作品已经删除、下架或当前公开列表无法命中该作品,统一作品详情会先进入 work-detail 阶段。此前该阶段在没有 selectedPublicWorkDetail 时不会渲染任何内容;用户关闭“作品不存在或已下架”的提示后,页面可能只剩空白区域。

修复

  1. resolveWorkNotFoundRecoveryAction(...) 覆盖 /works/detail、拼图公开详情和视觉小说公开详情,并复用运行态深链失效的回首页策略。
  2. 拼图公开详情、拼图运行态启动和拼图详情页读取的 404/NOT_FOUND 分支改为统一走公开作品失效恢复逻辑。
  3. 直接打开 /works/detail?work=... 的搜索失败分支会清理详情态、运行态临时数据,切回首页并清掉 URL query。
  4. work-detail 阶段在详情数据为空时渲染轻量读取态,避免异步间隙或异常分支出现纯白屏。

验证

  • npm run test -- src/routing/runtimeNotFoundRecovery.test.ts
  • npm run test -- src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx -t "direct missing public work detail alert returns to platform home"
  • npm run typecheck
  • npm run check:encoding -- src/routing/runtimeNotFoundRecovery.ts src/routing/runtimeNotFoundRecovery.test.ts src/components/platform-entry/PlatformEntryFlowShellImpl.tsx src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx docs/technical/PUBLIC_WORK_DETAIL_NOT_FOUND_RECOVERY_2026-05-11.md

关联文件

  1. src/routing/runtimeNotFoundRecovery.ts
  2. src/components/platform-entry/PlatformEntryFlowShellImpl.tsx
  3. src/components/rpg-entry/RpgEntryFlowShell.agent.interaction.test.tsx