From 411771af2fb372993b1ed4d72dd97799d0938de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BE=B7=E5=AE=87?= Date: Tue, 6 Oct 2026 18:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=85=A5=E5=8F=A3=E4=B8=8E?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E7=BB=9F=E4=B8=80=E6=94=B9=E7=94=A8=E8=A3=81?= =?UTF-8?q?=E5=89=AA=E5=90=8E=E7=9A=84=E9=A1=B9=E7=9B=AE=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - App.tsx 新增 exportProjectPath,对 localProject/projectPath 做一次 trim,空白即视作无项目 - onRequestExport 开关与 ArtifactsPanel 的 projectPath 都改用该值,避免纯空白路径照开门 --- apps/ai-game-creator-shell/src/App.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index 9c4b04cf0..858856187 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -1754,6 +1754,12 @@ export function App({ if (directProjectMode) { // 普通项目固定走 DirectProject 自己的聊天容器:订阅、历史、发送、队列和附件都由 // 容器持有,工作台壳只提供项目身份、入口首轮需求和两条权限门。 + // + // 导出入口与面板共用**同一个已裁剪**的路径:`localProject?.projectPath || projectPath` + // 只判真值,纯空白的路径会照开门;面板下游又都用 `Boolean(projectPath)` 当有效判据。 + // 这里统一裁一次,空白即视作「没有项目」。 + const exportProjectPath = + (localProject?.projectPath || projectPath || '').trim() || null; return ( <> setExportPanelOpen(true) - : undefined + exportProjectPath ? () => setExportPanelOpen(true) : undefined } onCancelConfirmation={cancelUiCommandConfirmation} onConfirmConfirmation={confirmUiCommand} @@ -1773,7 +1777,7 @@ export function App({ /> {exportPanelOpen ? ( setExportPanelOpen(false)}