From 075078f358e8df113cd6834a5efa97ee931d9633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 7 Oct 2026 11:08:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=81=87=E5=AE=BF=E4=B8=BB?= =?UTF-8?q?=E4=B8=8D=E5=8F=AF=E7=94=A8=E4=BF=9D=E6=8C=81=20dirty=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E9=99=88=E6=97=A7=E6=B3=A8=E5=86=8C=E8=A1=A8?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E6=9C=AA=E8=90=BD=E7=9B=98=E8=BE=93=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 保存失败分流后不再无条件 setDirty(false):exportUnavailable 分支保留 dirty - dirty 为真时 adoptable 保持 false,宿主恢复后的重读不会用旧注册表表单覆盖用户输入 - 冲突/未知失败仍归零 dirty,维持「同一份输入不反复打宿主」 --- .../export/state/useTaonierExport.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/apps/ai-game-creator-shell/src/view/project-development/export/state/useTaonierExport.ts b/apps/ai-game-creator-shell/src/view/project-development/export/state/useTaonierExport.ts index f05f29da8..1a64338fd 100644 --- a/apps/ai-game-creator-shell/src/view/project-development/export/state/useTaonierExport.ts +++ b/apps/ai-game-creator-shell/src/view/project-development/export/state/useTaonierExport.ts @@ -544,19 +544,25 @@ export function useTaonierExport({ return true; } catch (error) { if (projectPathRef.current !== projectPath) return false; - // 剩下的结果都要停下重试,等用户或下一次输入推着走:冲突等用户选、其余按 typed 失败给 - // 建议。共同点是 `dirty` 归零,避免同一份输入反复打宿主。 - setDirty(false); + // 冲突等用户选、其余按 typed 失败给建议。共同点是 `dirty` 归零,避免同一份输入反复 + // 打宿主;但 `exportUnavailable` 例外:宿主恢复前这份输入仍未落盘,保持 dirty, + // 否则下一次重读会把它当成「干净」而用陈旧的注册表内容覆盖。 const structured = asTaonierSaveFailure(error); if (!structured) { + setDirty(false); throwToErrorPool(String(error), error); return false; } - if (structured.type === 'saveConflict') setConflict(structured); - else if (structured.type === 'exportUnavailable') { + if (structured.type === 'saveConflict') { + setDirty(false); + setConflict(structured); + } else if (structured.type === 'exportUnavailable') { // 宿主侧事实故障:不落面板,直接抛给全局错误池上报。 throwToErrorPool(JSON.stringify(structured), error); - } else setFailure(structured); + } else { + setDirty(false); + setFailure(structured); + } return false; } });