简化提示

This commit is contained in:
2026-07-16 04:22:33 +00:00
parent d6ff106a0b
commit 828c6efac8
4 changed files with 19 additions and 19 deletions
@@ -1828,7 +1828,7 @@ pub(crate) async fn generate_editor_image_for_owner(
asset: source_record.asset,
project: completed_project,
warning: Some(editor_postprocess_fallback_warning(
"图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图",
"生成任务成功,后处理失败",
)),
},
));
@@ -4006,7 +4006,7 @@ pub(crate) async fn generate_editor_icon_spritesheet_for_owner(
spritesheet_asset: source_record.asset,
project: completed_project,
warning: Some(editor_postprocess_fallback_warning(
"图标图集已生成,但透明背景处理失败,已将原图放入画布;未生成透明图集和拆分素材",
"生成任务成功,后处理失败",
)),
},
));
@@ -4662,7 +4662,7 @@ pub(crate) async fn extract_editor_ui_design_assets_for_owner(
spritesheet_asset: source_record.asset,
project: completed_project,
warning: Some(editor_postprocess_fallback_warning(
"UI 素材图集已生成,但透明背景处理失败,已将原图放入画布;未生成透明图集和拆分素材",
"生成任务成功,后处理失败",
)),
},
));
@@ -9436,7 +9436,7 @@ mod tests {
asset: None,
project: None,
warning: Some(editor_postprocess_fallback_warning(
"图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图",
"生成任务成功,后处理失败",
)),
};
@@ -9456,7 +9456,7 @@ mod tests {
);
assert_eq!(
payload["warning"]["reason"],
json!("图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图")
json!("生成任务成功,后处理失败")
);
}
@@ -1410,7 +1410,7 @@ mod tests {
"imageSrc": "data:image/png;base64,SHOULD_NOT_PERSIST",
"warning": {
"code": "postprocess-failed-source-preserved",
"reason": "图片已生成,但透明背景处理失败,已将原图放入画布"
"reason": "生成任务成功,后处理失败"
},
"sliceWarning": {
"code": "insufficient-connected-components",
@@ -1427,7 +1427,7 @@ mod tests {
payload["warning"],
json!({
"code": "postprocess-failed-source-preserved",
"reason": "图片已生成,但透明背景处理失败,已将原图放入画布"
"reason": "生成任务成功,后处理失败"
})
);
assert!(payload.get("imageSrc").is_none());
@@ -1034,7 +1034,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
warning: {
code: 'postprocess-failed-source-preserved',
reason:
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
},
}),
);
@@ -1088,7 +1088,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
'layer-source:idle:角色换成蓝色披风:-',
);
expect(screen.getByTestId('generation-warning').textContent).toBe(
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
);
});
@@ -1685,7 +1685,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
}),
queueState: createQueueState({
warning:
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
}),
});
render(
@@ -1726,7 +1726,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
expect(applyProjectSnapshot).toHaveBeenCalledWith(backendProject);
expect(getExternalGenerationJobStatusMock).not.toHaveBeenCalled();
expect(screen.getByTestId('generation-warning').textContent).toBe(
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
);
expect(screen.getByTestId('layers').textContent).not.toContain(
'layer-generated-1',
@@ -1822,7 +1822,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
{
queueState: createQueueState({
warning:
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
}),
},
'editor-project-1',
@@ -1833,7 +1833,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
);
expect(onGenerationWarning).toHaveBeenCalledWith(
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
);
});
@@ -2408,7 +2408,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
warning: {
code: 'postprocess-failed-source-preserved',
reason:
'UI 素材图集已生成,但透明背景处理失败,已将原图放入画布;未生成透明图集和拆分素材。',
'生成任务成功,后处理失败。',
},
});
render(
@@ -2437,7 +2437,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
);
expect(screen.getByTestId('fit-count').textContent).toBe('1');
expect(screen.getByTestId('generation-warning').textContent).toBe(
'UI 素材图集已生成,但透明背景处理失败,已将原图放入画布;未生成透明图集和拆分素材。',
'生成任务成功,后处理失败。',
);
});
@@ -2576,7 +2576,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
warning: {
code: 'postprocess-failed-source-preserved',
reason:
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
},
}),
);
@@ -2618,7 +2618,7 @@ describe('useImageCanvasGenerationSubmissionWorkflow', () => {
'character:idle:open:layer-generated-1:placeholder:-',
);
expect(screen.getByTestId('generation-warning').textContent).toBe(
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
);
});
@@ -746,7 +746,7 @@ describe('editorProjectClient', () => {
warning: {
code: 'postprocess-failed-source-preserved',
reason:
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
},
});
@@ -758,7 +758,7 @@ describe('editorProjectClient', () => {
expect(result.warning).toEqual({
code: 'postprocess-failed-source-preserved',
reason:
'图片已生成,但透明背景处理失败,已将原图放入画布;未生成透明处理图。',
'生成任务成功,后处理失败。',
});
expect(requestJsonMock).toHaveBeenCalledWith(
'/api/editor/images/generations',