From c836ac604dad2c7179bdc297405c4cf20b577034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E7=89=A9?= <253518756@qq.com> Date: Mon, 22 Jun 2026 13:45:20 +0800 Subject: [PATCH] Treat character-action generations as video & UI tweaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle character-action generation results as real video assets: use backend previewVideoPath as layer src, set mediaType="video" and assetKind="character-animation", and store the first frame only as thumbnail/poster. Update docs to document the new behavior and preserve backend frame extraction/green-screen workflows. Update UI/UX: compact parameter labels (e.g. "16:9·1K"), quick-edit treats original image as an implicit last reference (hidden from the reference bar) and allows editable bottom capsules, and ensure exports preserve true media file types. Change upload toolbar icon to Upload and add tests to cover the icon and video-layer behavior; also add serialization/hydration test for video thumbnails and adjust many integration/unit tests to reflect new labels, sizes and generation semantics. Files touched include multiple docs under docs/, edited components and tests under src/components/image-editor/, and minor stylesheet updates. --- docs/project-memory/shared-memory/pitfalls.md | 8 + ...架构】图片画布编辑器MVP接入方案-2026-06-11.md | 9 +- ...】生成类面板Lovart统一改造方案-2026-06-17.md | 16 +- ...辑器】画板角色形象生成入口设计-2026-06-15.md | 4 +- ...CanvasBasicGenerationComposerView.test.tsx | 8 +- .../ImageCanvasBottomToolbarView.test.tsx | 25 ++ .../ImageCanvasBottomToolbarView.tsx | 4 +- ...CanvasEditorGenerationIntegration.test.tsx | 52 ++-- .../ImageCanvasEditorModel.test.ts | 46 +++ .../image-editor/ImageCanvasEditorModel.ts | 4 +- .../image-editor/ImageCanvasEditorTypes.ts | 2 + .../ImageCanvasExportModel.test.ts | 7 + .../ImageCanvasGenerationComposerView.tsx | 5 +- .../ImageCanvasGenerationDialogModel.test.ts | 9 +- .../ImageCanvasGenerationDialogModel.ts | 44 ++- ...eCanvasGenerationImageOptionsView.test.tsx | 12 +- .../ImageCanvasGenerationImageOptionsView.tsx | 29 +- .../ImageCanvasGenerationLayerModel.test.ts | 8 +- .../ImageCanvasGenerationLayerModel.ts | 26 +- .../ImageCanvasGenerationModel.test.ts | 19 +- .../ImageCanvasGenerationModel.ts | 64 +++- .../ImageCanvasGenerationSubmissionModel.ts | 6 +- .../ImageCanvasMetadataModalView.test.tsx | 18 ++ .../ImageCanvasMetadataModalView.tsx | 7 +- .../ImageCanvasQuickEditPanelView.test.tsx | 59 ++-- .../ImageCanvasQuickEditPanelView.tsx | 274 ++++++++++++++++-- ...ageCanvasSelectedLayerToolbarView.test.tsx | 11 +- .../ImageCanvasSelectedLayerToolbarView.tsx | 14 +- ...mageCanvasSpecGenerationPanelView.test.tsx | 4 +- .../ImageCanvasSpecGenerationPanelView.tsx | 17 +- ...anvasGenerationSubmissionWorkflow.test.tsx | 167 ++++++++++- ...ImageCanvasGenerationSubmissionWorkflow.ts | 170 ++++++++++- .../useImageCanvasGenerationWorkflow.test.tsx | 11 +- src/index.css | 12 +- 34 files changed, 987 insertions(+), 184 deletions(-) diff --git a/docs/project-memory/shared-memory/pitfalls.md b/docs/project-memory/shared-memory/pitfalls.md index 0463c496f..da76e56df 100644 --- a/docs/project-memory/shared-memory/pitfalls.md +++ b/docs/project-memory/shared-memory/pitfalls.md @@ -15,6 +15,14 @@ - 关联:相关文件、文档、提交或 Issue ``` +## 图片画布角色动作结果不能把首帧当主媒体 + +- 现象:画板里 `生成角色动作` 返回后显示成一张不可播放图片,点击下载或素材 ZIP 导出时拿到的也是 PNG,而不是动作视频。 +- 原因:后端已经生成 `previewVideoPath`,并继续执行抽帧、绿幕去背和帧素材 OSS 落盘;前端落层时却把 `frames[0].imageSrc` 当作图层主 `src`,且没有设置 `mediaType: "video"`,导致预览和导出都按图片处理。 +- 处理:角色动作结果图层主 `src` 必须使用 `previewVideoPath`,`mediaType` 固定为 `video`,`assetKind` 固定为 `character-animation`;首帧透明 PNG 只写入 `thumbnailSrc`,用于 `