Issue #4037 (phase 3 of #4098). An existing member pane can now be
dragged back onto its own workspace to rearrange it, landing with the
same snap-in split semantics an orphan drop gets.
- domain: add pure movePaneInWorkspace(root, sessionId, hint) composing
the existing prune + insert conventions (no-op for unknown/single-pane
self-drops; prune-first keeps target-inside-subtree drops correct).
- state: moveWorkspacePane / moveWorkspacePaneInWorkspaces touch only
workspaces[].root — session ids, tab order, focus fields and every AI
binding (anchorChatId etc.) are untouched by construction.
- drop flow: handleWorkspaceDrop routes same-workspace member drops to
the move op; cross-workspace drops stay rejected (#4098 policy) and
orphan drops are unchanged.
- preview: member panes drag via pointer events, so the split-hint
preview and drop are mirrored on the pointer stream while a member of
the active workspace is dragged; dropping a pane onto itself previews
and drops as a no-op.
Identity guarantee: a move never changes session ids, workspace id,
anchorChatId, focusedSessionId (focus is keyed by session id, so it
visually follows the moved pane), focusSessionOrder or tab order; the
moved tree roundtrips through netcatty_session_restore_v1 unchanged.
* fix: keep non-hibernated tabs active in background
* fix: scope background work to hibernation policy
* fix: bind background monitoring to its tab
* fix: measure hidden local workspaces
* 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>