From eba0b4df5eb2ebe94cb769a1dbebba0b40d3a535 Mon Sep 17 00:00:00 2001 From: thzxx Date: Mon, 20 Apr 2026 09:56:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=96=B0=E5=BB=BA=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E6=97=B6=E9=87=8D=E7=BD=AE=E5=B7=A5=E4=BD=9C=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E5=88=B0=E7=A9=BA=E9=97=B2=E7=8A=B6=E6=80=81=E5=B9=B6=E5=88=87?= =?UTF-8?q?=E5=9B=9E=E7=BB=88=E7=AB=AF=E9=A1=B5=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/main.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/renderer/main.ts b/src/renderer/main.ts index c684a76..4547ca8 100644 --- a/src/renderer/main.ts +++ b/src/renderer/main.ts @@ -27,7 +27,7 @@ import { restoreCronTasks } from './services/cron-manager.js'; import { setToolEnabled, setRunCommandMode, refreshMCPTools } from './services/tool-registry.js'; import { startAllMCPServers } from './services/mcp-client.js'; import { initToolConfirmModal } from './components/tool-confirm-modal.js'; -import { initWorkspacePanel } from './components/workspace-panel.js'; +import { initWorkspacePanel, clearToolCardsExternal, clearTerminalExternal, switchToTab } from './components/workspace-panel.js'; import { initLogPanel, addLog } from './services/log-service.js'; import { logInfo, logSuccess, logError, logDebug, logInit, logWarn } from './services/log-service.js'; import type { ChatSession } from './types.js'; @@ -280,6 +280,12 @@ async function startNewSession(): Promise { enableAutoScroll(); renderMessages(); updateTotalTokens(); + + // ── 重置工作空间到空闲状态 ── + clearToolCardsExternal(); + clearTerminalExternal(); + switchToTab('terminal'); + (document.querySelector('#chatInput') as HTMLElement)?.focus(); }