From f4b86770d084608322daa871d1e92c407814b4e1 Mon Sep 17 00:00:00 2001 From: Menghuan1918 Date: Sat, 8 Aug 2026 16:19:18 +0800 Subject: [PATCH] tabs: keep all tab content mounted (inactive hidden), so switching tabs never reloads a terminal Switching tabs used to unmount the active view; a terminal's unmount sent the tab-close frame, killing its pty, and switching back respawned a fresh shell. Every tab now stays mounted and inactive ones are display:none: a terminal keeps its WebSocket + pty + scrollback, an editor keeps its CodeMirror view and unsaved draft, explorer/git keep their data. The close frame now fires only when a tab is truly closed (close button, middle click, pane removal). Re-shown terminals re-fit via the existing ResizeObserver; editors re-measure via CodeMirror's own observer. --- README.md | 2 +- src/client/Sidebar.tsx | 1 - src/client/sidebar.module.css | 13 +++++++++++++ src/client/split-pane.tsx | 18 +++++++++++++++++- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 49bc46b..e93c511 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ control panel — **isolated per conversation session**. - Git: status / diff / stage / commit / branch / history(基础集) - 分栏工作台: VSCode 式拖拽分栏(拖 Tab 到分栏边缘即左右/上下拆分,拖到中间合并)、 分隔线拖拽、面板宽度拖拽;折叠后右缘展开按钮常驻 -- Tab 栏: 最大宽度 160px、横向滚动、`+` 紧贴最右 Tab(溢出时吸附右缘)、`+` 菜单新建 Tab;空分栏显示可打开类型卡片(点击即开) +- Tab 栏: 最大宽度 160px、横向滚动、`+` 紧贴最右 Tab(溢出时吸附右缘)、`+` 菜单新建 Tab;空分栏显示可打开类型卡片(点击即开);切换 Tab 不卸载内容(终端保持连接与回滚、编辑器保留未保存草稿) - 拦截: 对话"产出文件"行点击改为在侧边栏打开 - 样式完全复用 `--dsw-*` 主题变量与 `@deepseek-ai/dsh-client-ui-primitives` diff --git a/src/client/Sidebar.tsx b/src/client/Sidebar.tsx index c12c70d..285a301 100644 --- a/src/client/Sidebar.tsx +++ b/src/client/Sidebar.tsx @@ -205,7 +205,6 @@ export function Sidebar(props: { ctx: Context }) { const renderTab = (tab: SidebarTab) => (