From bd127846f70d678a78ef7fc42fe0cdf8497034ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Sat, 12 Sep 2026 13:36:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=88=86=E7=A6=BB=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=E5=9C=A8=E5=BF=99=E7=A2=8C=E6=80=81=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 保留 isSeparating 属于 isAiRunning 的全局语义 为内部分离保存增加受控 allowDuringSeparation 选项 --- .../src/view/ui-editor/useUiEditorPage.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts index eabaae116..b7637d6c1 100644 --- a/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts +++ b/apps/ai-game-creator-shell/src/view/ui-editor/useUiEditorPage.ts @@ -1196,7 +1196,7 @@ export function useUiEditorSession( if (separationResult === null) throw new Error('自动切分素材没有返回结果'); const completedResult = separationResult as SeparationDTO; - if (!(await save())) { + if (!(await save({ allowDuringSeparation: true }))) { throw new Error( '自动切分素材结果已写入编辑器,但 State 保存失败;sidecar 已保留,可继续恢复。', ); @@ -1342,13 +1342,19 @@ export function useUiEditorSession( } } - async function save() { + async function save(options?: { allowDuringSeparation?: boolean }) { + const allowDuringSeparation = + options?.allowDuringSeparation === true && + isSeparating && + !isSuggesting && + !isRecognizing && + !isMerging; if ( !resourceId || isSaving || isGenerating || isLoading || - isAiRunning || + (isAiRunning && !allowDuringSeparation) || loadError || persistedRevision === null || editor.isLocked