修复图标图集自动拆分降级
图集带背景原图和透明整图先写入项目资源与账号素材库并回填画布 自动拆分识别或持久化失败时保留图集并返回结构化警告 手动拆分限制图片尺寸、总像素和单次切片数量 同步共享契约、外部 OpenAPI、前端类型、设计文档和回归测试
This commit is contained in:
@@ -2082,6 +2082,10 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
|
||||
provider: 'VectorEngine',
|
||||
taskId: 'task-icons',
|
||||
iconImageSrcs: [],
|
||||
sliceWarning: {
|
||||
code: 'insufficient-connected-components',
|
||||
reason: '连通域数量不足',
|
||||
},
|
||||
});
|
||||
render(
|
||||
<SubmissionWorkflowHarness
|
||||
|
||||
@@ -897,6 +897,10 @@ describe('editorProjectClient', () => {
|
||||
spritesheetWidth: 512,
|
||||
spritesheetHeight: 512,
|
||||
iconImageSrcs: [],
|
||||
sliceWarning: {
|
||||
code: 'insufficient-connected-components',
|
||||
reason: '连通域数量不足',
|
||||
},
|
||||
prompt: '图标素材 prompt',
|
||||
actualPrompt: '图标素材 prompt',
|
||||
model: 'gemini-3.1-flash-image-preview',
|
||||
@@ -911,6 +915,10 @@ describe('editorProjectClient', () => {
|
||||
});
|
||||
|
||||
expect(result.taskId).toBe('icon-spritesheet-task-1');
|
||||
expect(result.sliceWarning).toEqual({
|
||||
code: 'insufficient-connected-components',
|
||||
reason: '连通域数量不足',
|
||||
});
|
||||
expect(requestJsonMock).toHaveBeenCalledWith(
|
||||
'/api/editor/icon-spritesheets/generations',
|
||||
expect.objectContaining({
|
||||
|
||||
@@ -300,11 +300,17 @@ export type EditorIconSpritesheetIconResult = {
|
||||
asset?: EditorAssetSnapshot | null;
|
||||
};
|
||||
|
||||
export type EditorIconSpritesheetSliceWarning = {
|
||||
code: string;
|
||||
reason: string;
|
||||
};
|
||||
|
||||
export type EditorIconSpritesheetGenerationResult = {
|
||||
spritesheetImageSrc: string;
|
||||
spritesheetWidth: number;
|
||||
spritesheetHeight: number;
|
||||
iconImageSrcs: EditorIconSpritesheetIconResult[];
|
||||
sliceWarning?: EditorIconSpritesheetSliceWarning | null;
|
||||
prompt: string;
|
||||
actualPrompt?: string | null;
|
||||
model: string;
|
||||
|
||||
Reference in New Issue
Block a user