兼容历史 UI 规范的统一图标入口
将历史 spec.generate 的 ui 类型映射到 icon\n补充 GenerationInputs V2 恢复回归测试
This commit is contained in:
@@ -1206,6 +1206,38 @@ describe('ImageCanvasGenerationDialogModel', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('maps legacy ui spec.generate inputs to the unified icon spec composer', () => {
|
||||
expect(
|
||||
createSameSourceGenerationDialogDraft({
|
||||
sourceLayer: createLayer({
|
||||
sourceType: 'generated',
|
||||
assetKind: 'icon-spec',
|
||||
generationInputs: {
|
||||
version: 2,
|
||||
action: 'spec.generate',
|
||||
fields: [
|
||||
{ id: 'specType', title: '规范类型', value: 'ui' },
|
||||
{ id: 'playSetting', title: '玩法设定', value: '消除玩法' },
|
||||
{ id: 'artStyle', title: '美术风格', value: '糖果玻璃' },
|
||||
],
|
||||
references: [],
|
||||
},
|
||||
}),
|
||||
availableLayers: [],
|
||||
canvasSize: { width: 960, height: 720 },
|
||||
viewport: { x: 0, y: 0, scale: 1 },
|
||||
mode: 'redraw',
|
||||
}),
|
||||
).toMatchObject({
|
||||
mode: 'spec',
|
||||
specType: 'icon',
|
||||
specValues: {
|
||||
playSetting: '消除玩法',
|
||||
artStyle: '糖果玻璃',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it('restores the narrowly scoped legacy scene recipe into the scene composer', () => {
|
||||
expect(
|
||||
createSameSourceGenerationDialogDraft({
|
||||
|
||||
@@ -1001,11 +1001,11 @@ function createNormalizedGenerationDialogDraft({
|
||||
'custom',
|
||||
);
|
||||
const specType: SpecGenerationType =
|
||||
specTypeValue === 'character' ||
|
||||
specTypeValue === 'ui' ||
|
||||
specTypeValue === 'icon'
|
||||
? specTypeValue
|
||||
: 'custom';
|
||||
specTypeValue === 'ui'
|
||||
? 'icon'
|
||||
: specTypeValue === 'character' || specTypeValue === 'icon'
|
||||
? specTypeValue
|
||||
: 'custom';
|
||||
return placeDraftBesideSourceLayer(
|
||||
{
|
||||
...createSpecDialogDraft({ canvasSize, viewport, specType }),
|
||||
|
||||
Reference in New Issue
Block a user