perf(terminal): reduce terminal tab-switch and layout jank (#1321)

* perf(terminal): smooth layout drags and faster tab switching

Defer xterm refit during split, sidebar, and host-tree drags while keeping pane containers in sync with live layout measurements. Refactor TerminalLayer into focused sections with TabBridge/memo optimizations and add the terminal host tree sidebar.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(terminal): keep side panels alive and guard session attach races

Prevent terminal boot unmount from leaking backend sessions, keep SFTP/scripts/theme/AI state when switching side tabs, and defer heavy SFTP UI mount so first entry stays responsive.

Co-authored-by: Cursor <cursoragent@cursor.com>

* perf(terminal): reduce tab switch jank

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
陈大猫
2026-06-09 03:35:03 +08:00
committed by GitHub
parent 53aef452cc
commit 36e5779d94
97 changed files with 7941 additions and 2252 deletions

View File

@@ -164,6 +164,8 @@ export const STORAGE_KEY_GROUP_CONFIGS = 'netcatty_group_configs_v1';
// Side Panel
export const STORAGE_KEY_SIDE_PANEL_WIDTH = 'netcatty_side_panel_width';
export const STORAGE_KEY_WORKSPACE_FOCUS_SIDEBAR_WIDTH = 'netcatty_workspace_focus_sidebar_width';
export const STORAGE_KEY_TERMINAL_HOST_TREE_WIDTH = 'netcatty_terminal_host_tree_width_v1';
export const STORAGE_KEY_TERMINAL_HOST_TREE_COLLAPSED = 'netcatty_terminal_host_tree_collapsed_v1';
// Port Forwarding (transient cross-window broadcast key)
export const STORAGE_KEY_PF_RECONNECT_CANCEL = '__netcatty_pf_cancel_reconnect';

View File

@@ -72,7 +72,8 @@ export const localStorageAdapter = {
return safeParse<T>(localStorage.getItem(key));
},
write<T>(key: string, value: T): boolean {
return safeSetItem(key, JSON.stringify(value));
const json = JSON.stringify(value);
return safeSetItem(key, json);
},
readString(key: string): string | null {
return localStorage.getItem(key);