修复图片修改参数恢复与提交一致性
- 图片修改面板优先恢复历史模型、比例和尺寸,并保留显式设置优先级 - 图片修改提交计划统一归一化参数并下发 model、aspectRatio、imageSize 和 size - 画布完成占位使用实际目标输出尺寸 - 补充参数恢复回归测试与编辑器方案说明
This commit is contained in:
@@ -419,6 +419,41 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
expect(createCharacterAnimationPanelDraft(createLayer())).toBeNull();
|
||||
});
|
||||
|
||||
it('restores persisted image parameters when creating edit drafts', () => {
|
||||
const sourceLayer = createLayer({
|
||||
model: IMAGE_MODEL_NANOBANANA2,
|
||||
generationInputs: {
|
||||
version: 2,
|
||||
action: 'image.edit',
|
||||
fields: [
|
||||
{ id: 'prompt', title: '修改要求', value: '改成雨天' },
|
||||
{ id: 'model', title: '模型', value: IMAGE_MODEL_GPT_IMAGE_2 },
|
||||
{ id: 'aspectRatio', title: '比例', value: '2:3' },
|
||||
{ id: 'imageSize', title: '尺寸', value: '2K' },
|
||||
],
|
||||
references: [],
|
||||
},
|
||||
});
|
||||
|
||||
expect(createEditDialogDraft(sourceLayer)).toMatchObject({
|
||||
prompt: '改成雨天',
|
||||
imageModel: IMAGE_MODEL_GPT_IMAGE_2,
|
||||
aspectRatio: '2:3',
|
||||
imageSize: '2K',
|
||||
});
|
||||
expect(
|
||||
createEditDialogDraft(sourceLayer, {
|
||||
imageModel: IMAGE_MODEL_NANOBANANA2,
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '1K',
|
||||
}),
|
||||
).toMatchObject({
|
||||
imageModel: IMAGE_MODEL_NANOBANANA2,
|
||||
aspectRatio: '16:9',
|
||||
imageSize: '1K',
|
||||
});
|
||||
});
|
||||
|
||||
it('preserves the resolved asset label in quick-edit dialog snapshots', () => {
|
||||
expect(
|
||||
createQuickEditGenerationDialogDraft({
|
||||
|
||||
Reference in New Issue
Block a user