From 423f2d71848fb124ec94750932e45d7bb39783d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Wed, 16 Sep 2026 18:50:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8B=AC=E7=AB=8B=E6=80=BB?= =?UTF-8?q?=E6=8E=A7=E8=81=8A=E5=A4=A9=E7=AA=97=E5=8F=A3=E6=9C=AA=E5=8F=91?= =?UTF-8?q?=E9=80=81=E8=8D=89=E7=A8=BF=E7=9A=84=E6=81=A2=E5=A4=8D=20-=20Ap?= =?UTF-8?q?p.tsx=20=E5=A2=9E=E5=8A=A0=20supervisorChatDraftHydratedRef=20?= =?UTF-8?q?=E5=AE=88=E5=8D=AB=E7=9A=84=E6=8C=82=E8=BD=BD=E6=B0=B4=E5=90=88?= =?UTF-8?q?=EF=BC=9A=E7=8B=AC=E7=AB=8B=E6=80=BB=E6=8E=A7=E8=81=8A=E5=A4=A9?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E6=8C=82=E8=BD=BD=E8=B5=B0=20loadProjectConv?= =?UTF-8?q?ersation=EF=BC=8C=E4=B8=8D=E7=BB=8F=E8=BF=87=20openWorkspace?= =?UTF-8?q?=EF=BC=8C=E6=AD=A4=E5=89=8D=20sessionStorage=20=E9=87=8C?= =?UTF-8?q?=E7=9A=84=E8=8D=89=E7=A8=BF=E5=8F=AA=E5=86=99=E4=B8=8D=E8=AF=BB?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E8=BD=BD=E5=90=8E=E4=B8=BA=E7=A9=BA=20-=20?= =?UTF-8?q?=E4=BB=85=E5=9C=A8=20supervisorChatOnly=E3=80=81=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=8C=81=E4=B9=85=E5=8C=96=E8=8D=89=E7=A8=BF=E4=B8=94?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E5=B7=B2=E6=8C=82=E8=BD=BD=E6=97=B6?= =?UTF-8?q?=E5=9B=9E=E5=A1=AB=E4=B8=80=E6=AC=A1=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E7=94=A8=E6=88=B7=E5=90=8E=E7=BB=AD=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ai-game-creator-shell/src/App.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index 77ea9afae..eed5fe807 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -2075,6 +2075,7 @@ export function App({ const agentRuntimeResumeProjectPathRef = useRef(null); const agentRunHistoryLoadingMoreRef = useRef(false); const initialProjectOpenedRef = useRef(false); + const supervisorChatDraftHydratedRef = useRef(false); const pendingUiConfirmationActionRef = useRef<(() => void) | null>(null); const queueRunLocalShortcutRef = useRef<() => void>(() => undefined); const executeRunLocalRef = useRef<(announceToChat: boolean) => void>( @@ -3078,6 +3079,16 @@ export function App({ if (!supervisorChatOnly) { return; } + // 独立总控聊天窗口的挂载路径直接走 loadProjectConversation,不经过 + // openWorkspace,所以草稿的读取要在这里补一次;只回填一次,之后的渲染不再 + // 覆盖用户正在输入的内容。输入框尚未挂载时不移除守卫,等它出现再水合。 + if (!supervisorChatDraftHydratedRef.current) { + const persistedDraft = readSupervisorChatDraft(initialProjectPath); + if (persistedDraft && chatComposerRef.current) { + supervisorChatDraftHydratedRef.current = true; + chatComposerRef.current.replaceText(persistedDraft); + } + } const draft = chatComposerRef.current?.getDraft(); if (!draft || !hasMeaningfulDirectCodexContent(draft.content)) { return;