Files
Genarrative/docs/technical/CREATION_WORK_SHELF_UNIFICATION_2026-04-25.md
kdletters cbc27bad4a
Some checks failed
CI / verify (push) Has been cancelled
init with react+axum+spacetimedb
2026-04-26 18:06:23 +08:00

47 lines
2.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 作品货架统一 2026-04-25
## 背景
创作中心目前已经把 RPG、大鱼吃小鱼、拼图三类作品展示在同一个网格里但前端组件仍直接消费三类原始 works
1. RPG 使用 `status``title``subtitle``canEnterWorld`
2. 大鱼使用 `status``title`、资源完成度字段。
3. 拼图使用 `publicationStatus``levelName``authorDisplayName``themeTags`
这导致筛选、计数、按钮文案、卡片标题、副标题、标签、删除忙碌态都在 UI 组件里做三套判断。后续再接新作品类型时,货架组件会继续膨胀。
## 目标
1. 新增前端统一作品货架视图模型 `CreationWorkShelfItem`
2. 由归一化函数把 RPG / Big Fish / Puzzle works 映射成统一字段。
3. `CustomWorldCreationHub` 只负责筛选、空态和动作分发。
4. `CustomWorldWorkCard` 只负责渲染统一字段,不再理解三类原始 schema。
## 非目标
1. 本轮不新增后端统一 works 聚合接口。
2. 不改变三类现有 works API contract。
3. 不改变平台首页公开广场的 gallery 合并逻辑。
4. 不改变删除、体验、恢复草稿的业务规则。
## 统一字段
`CreationWorkShelfItem` 至少包含:
1. `id`:稳定货架 id。
2. `kind``rpg | big-fish | puzzle`
3. `status``draft | published`
4. `title / subtitle / summary / updatedAt`
5. `coverImageSrc / coverRenderMode / coverCharacterImageSrcs`
6. `badges`:状态、类型、阶段、标签等展示徽标。
7. `metrics`:角色数、地点数、素材完成度、游玩数等底部指标。
8. `openActionLabel`:卡片无障碍文案与主动作语义。
9. `source`:保留原始 work用于平台壳层执行动作。
## 验收
1. 创作中心三类作品仍在同一个网格展示。
2. 草稿 / 已发布筛选计数统一从 `CreationWorkShelfItem.status` 读取。
3. 卡片渲染不再直接判断 `publicationStatus` 或不同 works schema 的标题字段。
4. 现有创作中心交互测试通过。