Files
Genarrative/apps
suzmii 5798551b21
Project CI / AI game creator shell Rust lane 1/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust lane 2/2 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
feat(游戏共创): 共创列表补上真实封面(有界 data URL,失败回退首字占位)
- 新命令 `read_public_game_cover_preview(objectKey)`:复用发布面板封面那套链路
  (`read-url` 换签 → `resolve_canvas_resource_download_with_limit_route_and_fence` 有界下载 →
  `cover_preview_data_url`),返回**有界 data URL**。
  为什么不返回签名地址让渲染层 `<img src>`:AGC 既有约定是「渲染层不自行拼 read-url、不接触对象键
  与 bearer token、也不让 WebView 直连签名地址」(`commands.rs` 里同一口径的注释),因此沿用
  data URL 方案——顺带免掉签名过期与 CSP 白名单两个问题。
  对象键做最小校验(非空、≤512、不含 `..`);失败如实返回 `Err`,由调用方回退占位。
- 渲染层 `platformForkCover.ts`:会话内缓存 + 并发去重。
  · 成功:会话内一直复用(data URL 自身不过期);
  · 失败:缓存 60 秒(沿用网页端失败缓存窗口),避免同一张坏图在每张卡片上反复重试;
  · 提供 `clearCoverPreviewCache()` 供换号时清空(换号后旧封面可能已无权访问)。
- `usePlatformForkCovers` 钩子按当前列表批量解析;卡片上有封面就 `<img>`(`object-cover`),
  没有封面 / 换签失败 / 超限一律**保留原来的首字占位 + `coverColor` 底色**(降级逐条测到)。

测试:新增一条覆盖三种情形——有封面(断言 `src` 是命令返回的 data URL)、换签失败(保留占位、
不出现第二张 `<img>`)、没有 `coverObjectKey`(不发换签请求)。
2026-10-06 11:56:34 +08:00
..