From e7345508df96a772c432c021e7c9948c721505d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Fri, 4 Sep 2026 15:31:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=8F=96UI=E5=B7=A5=E4=BD=9C=E6=B5=81?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=96=87=E6=A1=88=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 拆分通知类型与文案辅助函数 修复组件快速刷新导出约束 --- .../components/WorkflowCompletionModal.tsx | 40 +++++++++++++++++++ .../components/workflowCompletionNotice.ts | 20 ++++++++++ 2 files changed, 60 insertions(+) create mode 100644 apps/ai-game-creator-shell/src/view/ui-editor/components/WorkflowCompletionModal.tsx create mode 100644 apps/ai-game-creator-shell/src/view/ui-editor/components/workflowCompletionNotice.ts 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 '绑定视觉素材'; +}