统一画布快速编辑白名单与入口行为 (#140)
Project CI / Repository checks (push) Successful in 56s
Project CI / Frontend tests (push) Successful in 4m1s
Project CI / Backend tests (push) Successful in 4m26s
Project CI / Native shell tests (push) Successful in 15m12s

- 使用白名单控制快速编辑功能的显示

- 同步浮动工具栏、右键菜单、打开入口和提交门禁
- 禁用角色动作序列帧(整体)、音频和单个图标(explain: backend reject)的快速编辑

- 把快速编辑api改为只接受resource Id | asset Id,删除 image_src 参数, 以保证校验

其中包含生产数据迁移。迁移用于清理历史普通图片错误持久化的 assetKind="image",覆盖 asset → project-resource → showcase → canvas 四个作用域,并包含 operator 鉴权、分批 dry-run、批次 SHA-256 绑定 apply、active 结构化画
  > 布迁移摘要同步及最终零残留复核。

---------

Co-authored-by: kdletters <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/140
Co-authored-by: 王德宇 <kvtodev@outlook.com>
Co-committed-by: 王德宇 <kvtodev@outlook.com>
This commit was merged in pull request #140.
This commit is contained in:
2026-08-12 14:46:24 +08:00
committed by 段舒康
parent 4c3c0e9cd4
commit 8abeb333bb
61 changed files with 11979 additions and 688 deletions
@@ -50,7 +50,7 @@ import {
IMAGE_MODEL_GPT_IMAGE_2,
IMAGE_MODEL_NANOBANANA2,
isNormalizedCanvasGenerationInputs,
isQuickEditUnsupportedAssetKind,
isQuickEditSupportedLayer,
resolveCharacterAnimationSourceImageSrc,
resolveEditorImageGenerationPixelSize,
resolveImageGenerationErrorMessage,
@@ -530,16 +530,6 @@ describe('ImageCanvasGenerationModel', () => {
},
}),
).toBe(true);
expect(
canOpenRedrawPanel({
...generatedLayer,
assetKind: 'image',
generationInputs: {
fields: [{ title: '画面内容', value: '非场景展示字段' }],
references: [],
},
}),
).toBe(false);
expect(
canOpenRedrawPanel({
...generatedLayer,
@@ -931,17 +921,52 @@ describe('ImageCanvasGenerationModel', () => {
{ label: 'gpt-image-2', value: 'gpt-image-2' },
]);
expect(
isQuickEditUnsupportedAssetKind({
isQuickEditSupportedLayer({
...buildSourceLayer(),
assetKind: 'icon',
mediaType: 'image',
assetKind: null,
}),
).toBe(true);
expect(
isQuickEditUnsupportedAssetKind({
isQuickEditSupportedLayer({
...buildSourceLayer(),
assetKind: 'icon',
}),
).toBe(false);
expect(
isQuickEditSupportedLayer({
...buildSourceLayer(),
assetKind: 'icon-spritesheet',
}),
).toBe(true);
expect(
isQuickEditSupportedLayer({
...buildSourceLayer(),
assetKind: 'scene',
resourceAssetKind: 'icon',
}),
).toBe(true);
expect(
isQuickEditSupportedLayer({
...buildSourceLayer(),
mediaType: 'image-sequence',
assetKind: 'character-animation',
}),
).toBe(false);
expect(
isQuickEditSupportedLayer({
...buildSourceLayer(),
mediaType: 'audio',
assetKind: 'sound-effect',
}),
).toBe(false);
expect(
isQuickEditSupportedLayer({
...buildSourceLayer(),
mediaType: 'video',
assetKind: 'video',
}),
).toBe(true);
});
it('adds reference image semantics and snapshots for spec generation references', () => {