From 5bad82336d1c79888cac5eb73afca8e846e136c6 Mon Sep 17 00:00:00 2001 From: thzxx Date: Sat, 13 Jun 2026 08:17:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20initWorkspacePanel=20=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E9=BB=98=E8=AE=A4=E5=B7=A5=E5=85=B7=E9=A1=B5?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Electron窗口关闭再打开时渲染进程不销毁,模块级activeTab 保留用户上次切换的值。initWorkspacePanel启动时强制重置。 --- src/renderer/components/workspace-panel.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer/components/workspace-panel.ts b/src/renderer/components/workspace-panel.ts index 10e6c27..11931af 100644 --- a/src/renderer/components/workspace-panel.ts +++ b/src/renderer/components/workspace-panel.ts @@ -191,6 +191,11 @@ function ansiToHtml(raw: string): string { // ── 初始化 ── export async function initWorkspacePanel(): Promise { + // ── 强制重置默认页签:Electron 窗口关闭再打开时渲染进程未销毁, + // 模块级 activeTab 可能保留上次用户手动切换的值 + activeTab = 'tools'; + renderPanel(); + const bridge = window.metonaDesktop; if (!bridge?.isDesktop) { logDebug('非桌面环境,跳过工作空间面板初始化');