diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowCompletionModal.tsx b/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowCompletionModal.tsx new file mode 100644 index 000000000..fbda3f214 --- /dev/null +++ b/apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowCompletionModal.tsx @@ -0,0 +1,40 @@ +import { ThemedModal } from '../../../components/modal/ThemedModal'; +import type { WorkflowCompletionNotice } from './workflowCompletionNotice'; +import { workflowStepLabel } from './workflowCompletionNotice'; + +export function WorkflowCompletionModal({ + notice, + onClose, +}: { + notice: WorkflowCompletionNotice | null; + onClose: () => void; +}) { + if (!notice) return null; + const stepLabel = workflowStepLabel(notice.step); + const outcomeLabel = notice.outcome === 'success' ? '完成' : '失败'; + return ( + +

+ {stepLabel} + {outcomeLabel} +

+

+ {notice.message} +

+
+ +
+
+ ); +} diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/components/workflowCompletionNotice.ts b/apps/ai-game-creator-shell/src/view/ui-editor/components/workflowCompletionNotice.ts new file mode 100644 index 000000000..02fd867f8 --- /dev/null +++ b/apps/ai-game-creator-shell/src/view/ui-editor/components/workflowCompletionNotice.ts @@ -0,0 +1,20 @@ +import type { UiEditorStepId } from '../model'; + +export type WorkflowCompletionNotice = { + step: UiEditorStepId; + outcome: 'success' | 'failure'; + message: string; +}; + +export function appendWorkflowCheckPrompt(message: string): string { + const trimmed = message.trim(); + if (!trimmed) return '请检查。'; + if (trimmed.includes('请检查')) return trimmed; + return `${trimmed.replace(/[。!?!?]+$/u, '')},请检查。`; +} + +export function workflowStepLabel(step: UiEditorStepId): string { + if (step === 'reference-analysis') return '分析参考图'; + if (step === 'structure-recognition') return '识别界面结构'; + return '绑定视觉素材'; +}