From 1f13412dde71c100bb9a8930c0ed89f19206b2d5 Mon Sep 17 00:00:00 2001 From: Suzumiya Date: Tue, 15 Sep 2026 18:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E9=A1=B9=E7=9B=AE=E6=97=B6=E6=B8=85?= =?UTF-8?q?=E7=A9=BA=E8=BE=93=E5=85=A5=E7=9B=92=E5=BE=85=E5=8F=91=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8E=E6=B6=88=E6=81=AF=E9=98=9F=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 待发附件的 localPath 是项目相对路径、队列也属于刚结束的那条对话;切项目后不清空会把上一个项目的附件路径带进下一个回合。 只新增一个跟随 localProject.projectPath 的 effect,其余输入盒状态与后端协议不变。 --- 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 b1e65d5fc..703ebcaf7 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -787,6 +787,17 @@ export function App({ useState(false); const queuedChatTurnSequenceRef = useRef(0); const chatComposerRef = useRef(null); + /** + * 切项目即清空只属于上一个项目的输入盒状态:待发附件的 `localPath` 是**项目相对**的, + * 队列也属于刚结束的那条对话;留着会把 A 项目的附件路径带进 B 项目的下一个回合。 + */ + useEffect(() => { + setChatAttachments([]); + setChatAttachmentNotice(''); + setChatComposerNotice(''); + setChatTurnQueue([]); + chatTurnQueueRef.current = []; + }, [localProject?.projectPath]); const [chatAgentBusy, setChatAgentBusy] = useState(false); const [directCodexProgress, setDirectCodexProgress] = useState(''); const [directCodexStatus, setDirectCodexStatus] = useState<