修复画布参考图上传删除链路 (#164)
Project CI / Repository checks (push) Successful in 3m3s
Project CI / Frontend tests (push) Successful in 3m32s
Project CI / Backend tests (push) Successful in 5m45s
Project CI / Native shell tests (push) Successful in 16m17s

主站规范生成支持多张参考图

修复普通生成参考图删除与提交状态不同步

优化触屏设备删除按钮可达性并补充回归测试

---------

Co-authored-by: kdletters <kdletters@qq.com>
Reviewed-on: http://192.168.35.82/git/GenarrativeAI/Genarrative/pulls/164
Co-authored-by: 孟豪 <mh18530625731@163.com>
Co-committed-by: 孟豪 <mh18530625731@163.com>
This commit was merged in pull request #164.
This commit is contained in:
2026-08-21 11:55:32 +08:00
committed by 段舒康
parent 7e3adc38b9
commit e4e3cab559
20 changed files with 698 additions and 72 deletions
@@ -33,6 +33,7 @@ import {
createVideoGenerationDialogDraft,
getUnavailableNormalizedGenerationInputReferences,
hideGeneratedLayerComposerAfterBlur,
resolveSpecGenerationReferences,
updateCharacterAnimationDurationPanel,
updateIconDescriptionsTextInDialog,
updateSpecFormDialogValue,
@@ -1554,6 +1555,7 @@ describe('ImageCanvasGenerationDialogModel', () => {
prompt: '',
status: 'failed',
errorMessage: '失败',
specType: 'icon',
},
sourceLayer,
),
@@ -1562,6 +1564,29 @@ describe('ImageCanvasGenerationDialogModel', () => {
errorMessage: undefined,
specReference: { label: '参考图' },
});
const legacySpecReference = {
id: 'legacy-spec-reference',
label: '历史参考图',
src: 'data:image/png;base64,legacy',
};
const migratedSpecDialog = appendGenerationReference(
{
mode: 'spec',
prompt: '',
status: 'idle',
specType: 'character',
specReference: legacySpecReference,
},
sourceLayer,
);
expect(migratedSpecDialog).toMatchObject({
specReference: null,
generationReferences: [legacySpecReference, { label: '参考图' }],
});
expect(resolveSpecGenerationReferences(migratedSpecDialog)).toEqual(
migratedSpecDialog?.generationReferences,
);
expect(
appendGenerationReference(
{
@@ -1654,6 +1679,49 @@ describe('ImageCanvasGenerationDialogModel', () => {
});
});
it('restores canonical non-icon spec references for same-source generation', () => {
const legacyReference = {
id: 'legacy-reference',
label: '历史参考',
src: 'data:image/png;base64,legacy',
};
const currentReference = {
id: 'current-reference',
label: '当前参考',
src: 'data:image/png;base64,current',
};
expect(
createSameSourceGenerationDialogDraft({
sourceLayer: createLayer({
sourceType: 'generated',
assetKind: 'spec',
generationInputs: {
fields: [{ title: '规范类型', value: '角色规范' }],
references: [],
},
}),
sourceDialog: {
id: 'source-spec-dialog',
mode: 'spec',
prompt: '',
status: 'idle',
specType: 'character',
specReference: legacyReference,
generationReferences: [currentReference],
},
canvasSize: { width: 960, height: 720 },
viewport: { x: 0, y: 0, scale: 1 },
mode: 'redraw',
}),
).toMatchObject({
mode: 'spec',
specType: 'character',
specReference: null,
generationReferences: [currentReference],
});
});
it('limits Seedance canvas-picked references by media type', () => {
const videoDialog: GenerateDialogState = {
mode: 'video',