fix: complete jump-hop frontend wiring

This commit is contained in:
kdletters
2026-05-22 06:19:59 +08:00
parent 7b8cb82bf0
commit 1756b83789
10 changed files with 132 additions and 2 deletions

View File

@@ -1265,3 +1265,19 @@
- 处理:`BarkBattleConfigEditor` 需要区分“系统默认词池”和“创作者已手动编辑”。未手动编辑时随主题 / 形象描述自动重算;手动编辑后才冻结为自定义词池。默认词池只在命中狗相关关键词时加入狗叫词,非狗主题使用科技、幻想或通用高能词。
- 验证:`npm run test -- src/components/bark-battle-creation/BarkBattleConfigEditor.test.tsx src/games/bark-battle/ui/__tests__/BarkBattleRuntimeShell.test.tsx`,并确认非狗主题的拟声词不含 `汪`
- 关联:`src/components/bark-battle-creation/BarkBattleConfigEditor.tsx``src/games/bark-battle/application/BarkBattleConfig.ts``src/games/bark-battle/ui/BarkBattleRuntimeShell.tsx`
## Jenkins Web 构建公开作品号导出缺失优先补 publicWorkCode
- 现象:`Genarrative-Web-Build``npm run build:production-release -- --component web` 阶段失败Rollup 报 `"buildJumpHopPublicWorkCode" is not exported by "src/services/publicWorkCode.ts"`,但导入方 `rpgEntryWorldPresentation.ts``PlatformEntryFlowShellImpl.tsx` 已经引用该玩法公开码函数。
- 原因:玩法分支合并时容易只带入新玩法的 `publicWorkCode.ts` 导出,覆盖或遗漏另一个玩法的公开码 builder / matcherVite 构建会在静态导出检查阶段直接失败。
- 处理:在 `src/services/publicWorkCode.ts` 中保持每个玩法的 `build<Play>PublicWorkCode``isSame<Play>PublicWorkCode` 成对导出;跳一跳使用 `JH-` 前缀和 profileId 后 8 位规范化后缀。补 `src/services/publicWorkCode.test.ts` 覆盖 builder 和 matcher避免后续合并再次丢失导出。
- 验证:`npm test -- src/services/publicWorkCode.test.ts`,并用 `npm run build:production-release -- --component web --name <临时名>` 复现 Jenkins web 构建路径。若 `npm run typecheck` 仍报 JumpHop 阶段或状态变量缺口,那是远端当前 JumpHop 接线未收齐的独立问题,不等同于该 Rollup 导出失败。
- 关联:`src/services/publicWorkCode.ts``src/components/rpg-entry/rpgEntryWorldPresentation.ts``src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``docs/【开发运维】本地开发验证与生产运维-2026-05-15.md`
## 跳一跳前端壳层接线不要只合渲染分支
- 现象:`npm run typecheck` 大量报 `setJumpHopSession``jumpHopRun``jumpHopGalleryEntries``mapJumpHopWorkToPublicWorkDetail` 不存在,以及 `"jump-hop-runtime" is not assignable to SelectionStage`;即使 typecheck 过了,分享或刷新 `/runtime/jump-hop?work=...` 仍可能掉回首页。
- 原因跳一跳工作台、生成页、结果页、runtime 和推荐流渲染分支已经合入 `PlatformEntryFlowShellImpl.tsx`但平台壳层状态、public detail mapper、`SelectionStage` union 与 `appPageRoutes.ts` 阶段路由映射没有一并合入;发现页卡片分类也没有先判断 `isJumpHopGalleryEntry`,导致 fallback 访问 RPG `themeMode`
- 处理:`platformEntryTypes.ts` 必须注册 `jump-hop-workspace/generating/result/runtime/gallery-detail``appPageRoutes.ts` 必须补 `/creation/jump-hop/workspace``/creation/jump-hop/generating``/creation/jump-hop/result``/gallery/jump-hop/detail``/runtime/jump-hop``PlatformEntryFlowShellImpl.tsx` 必须持有 JumpHop session/work/run/gallery/runtimeReturnStage/generationState/error/busy并提供 `mapJumpHopWorkToPublicWorkDetail``RpgEntryHomeView.tsx` 的公开卡片类型描述要给 JumpHop 单独返回 `跳一跳`
- 验证:`npm run typecheck`,并跑 `npm test -- src/routing/appPageRoutes.test.ts` 覆盖 JumpHop 阶段路径。
- 关联:`src/components/platform-entry/platformEntryTypes.ts``src/routing/appPageRoutes.ts``src/components/platform-entry/PlatformEntryFlowShellImpl.tsx``src/components/rpg-entry/RpgEntryHomeView.tsx``docs/【玩法创作】平台入口与玩法链路-2026-05-15.md`