Files
Netcatty/domain/systemManager
KenX049andbincxz bcce829294 feat(tabs): move a tab to its own window without reconnecting (#4202)
* feat(tabs): move a tab to its own window without reconnecting (#4201)

Adds "Move Tab to New Window" to the tab context menu. Instead of opening
a new connection like "Copy Tab to New Window", the tab is hidden from the
tab bar and an attach popup takes over the same live PTY, so bastion
sessions are not re-authenticated and no extra seat is used. Closing the
popup returns the tab (with its screen state) to the window it came from.

- popup lifecycle notifies the home window via terminal-popup:attach-closed
- new runtime poppedOut flag; popped-out tabs still persist for restore and
  are not labelled as AI silent sessions in the tray

* fix(tabs): keep moved tabs alive when their source window closes

- A moved-tab popup registers as the lifetime heir of its session. If the
  source window is destroyed, ownership passes to the popup instead of the
  session being closed (worker and in-process paths). AI observe popups are
  unchanged.
- If the source window is gone when the popup closes, skip the hand-back so
  the popup's ownership closes the session.
- Only offer/allow Move Tab to New Window for connected sessions; attach
  mode cannot connect or reconnect a backend.

* fix(tabs): expose Move Tab to New Window through TerminalHost

The handler was registered but not passed into the terminal domain bag,
so AppView received undefined and the menu item never rendered.

* fix(tabs): address move-to-window focus, crash ownership, live count, history, and AI context review findings

* fix(tabs): activate moved-tab lifetime heir only after output rebind succeeds

* fix(tabs): wait for popup attachment before hiding tab and exclude plugin sessions

* fix(tabs): confirm renderer reattach before resolving move and await output restore before unhiding tab

* fix(tabs): preserve detached output across popup crashes and avoid focusing main window from tray

* fix(tabs): deliver attach snapshots and output restore directly to peer session windows

* fix(tabs): schedule automatic output restore retries when popup recovery fails

* fix(tabs): handle reopen replay preservation, stale restore cancellation, startup workspace move, and shutdown log capture

* fix(tabs): reassert popped-out state after tray reopen

* test(terminal): provide log finalizer stubs in popup snapshot harness

---------

Co-authored-by: bincxz <16399091+binaricat@users.noreply.github.com>
2026-11-24 10:50:36 +08:00
..