完善快速编辑参考图与生成占位
- 快速编辑支持最多8张额外参考图,并将原图自动作为最后一张参考图提交 - 快速编辑尺寸和模型沿用原图配置,按禁用态参数胶囊展示 - 快速编辑提交前同步改写原图引用为实际图序号 - 快速编辑生成改为创建独立画布生成占位,并支持键盘删除生成中对象 - 对齐生成类面板参考图图标、规范类固定参数和相关文档测试
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
assignUiDesignSpecReference,
|
||||
closeGenerateComposerDialog,
|
||||
createBackgroundMusicGenerationDialogDraft,
|
||||
createCharacterAnimationGenerationDialogDraft,
|
||||
createCharacterAnimationPanelDraft,
|
||||
createCharacterGenerationDialogDraft,
|
||||
createEditDialogDraft,
|
||||
@@ -240,6 +241,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
prompt: '',
|
||||
size: '1024x768',
|
||||
model: 'gpt-image-2',
|
||||
quickEditReferences: [],
|
||||
status: 'idle',
|
||||
});
|
||||
expect(createCharacterAnimationPanelDraft(sourceLayer)).toEqual({
|
||||
@@ -254,6 +256,47 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
expect(createCharacterAnimationPanelDraft(createLayer())).toBeNull();
|
||||
});
|
||||
|
||||
it('creates character animation generation dialog drafts for character layers', () => {
|
||||
const canvasSize = { width: 960, height: 720 };
|
||||
const viewport = { x: 0, y: 0, scale: 1 };
|
||||
const characterLayer = createLayer({
|
||||
id: 'layer-character',
|
||||
assetKind: 'character',
|
||||
});
|
||||
|
||||
expect(
|
||||
createCharacterAnimationGenerationDialogDraft({
|
||||
canvasSize,
|
||||
viewport,
|
||||
layer: characterLayer,
|
||||
}),
|
||||
).toMatchObject({
|
||||
mode: 'character-animation',
|
||||
sourceLayerId: 'layer-character',
|
||||
status: 'idle',
|
||||
composerOpen: true,
|
||||
characterAnimationResolution: '480p',
|
||||
characterAnimationRatio: 'same',
|
||||
characterAnimationFrameCount: 32,
|
||||
characterAnimationDurationSeconds: 4,
|
||||
placeholder: {
|
||||
x: 270,
|
||||
y: 150,
|
||||
width: 420,
|
||||
height: 420,
|
||||
originalWidth: 1024,
|
||||
originalHeight: 1024,
|
||||
},
|
||||
});
|
||||
expect(
|
||||
createCharacterAnimationGenerationDialogDraft({
|
||||
canvasSize,
|
||||
viewport,
|
||||
layer: createLayer(),
|
||||
}),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
it('resets failed character and icon dialogs when picking references', () => {
|
||||
const characterDialog: GenerateDialogState = {
|
||||
mode: 'character',
|
||||
@@ -288,7 +331,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
mode: 'icon',
|
||||
prompt: '',
|
||||
status: 'failed',
|
||||
errorMessage: '请选择图标素材规范',
|
||||
errorMessage: '请选择图标规范',
|
||||
};
|
||||
expect(
|
||||
assignIconSpecReference(
|
||||
@@ -301,6 +344,28 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
iconSpecReference: { id: 'canvas-layer-source' },
|
||||
});
|
||||
expect(assignIconSpecReference(iconDialog, sourceLayer)).toBe(iconDialog);
|
||||
expect(
|
||||
assignIconSpecReference(
|
||||
iconDialog,
|
||||
createLayer({
|
||||
title: '旧UI素材规范',
|
||||
assetKind: 'spec',
|
||||
generationInputs: {
|
||||
fields: [
|
||||
{
|
||||
title: '玩法设定',
|
||||
value: '生成一张完整游戏UI规范汇总设定展板',
|
||||
},
|
||||
],
|
||||
references: [],
|
||||
},
|
||||
}),
|
||||
),
|
||||
).toMatchObject({
|
||||
status: 'idle',
|
||||
errorMessage: undefined,
|
||||
iconSpecReference: { label: '旧UI素材规范' },
|
||||
});
|
||||
});
|
||||
|
||||
it('routes picked canvas references to spec, image, video, and UI design fields', () => {
|
||||
|
||||
Reference in New Issue
Block a user