fix: keep workspace panes mounted so they don't render blank after switching back#137
Open
mpmisha wants to merge 1 commit into
Open
Conversation
…itching back Switching workspaces rendered a single <TilingLayout/> bound to the active workspace's layout.tilingRoot, so the previous workspace's TerminalPanels unmounted and their xterm instances were disposed. PTY output produced while a workspace was hidden was dropped, and the pane came back blank/stale until a manual resize fired SIGWINCH and the running app (e.g. Copilot CLI) redrew. Render every workspace's tiling tree as a stacked, absolutely-positioned layer in .layout-area (active visible, inactive visibility:hidden but still sized and rendering) and mount portals for ALL terminals via the existing TASK-158 host system. Each xterm keeps consuming its PTY while hidden, so switching back is instant and current - no resize, nothing lost. - TilingLayout.tsx: per-workspace stacked layers; portals + host GC over all terminals; active-empty layer shows SessionLoading while restoring (preserves TASK-117 no-empty-state-flash) / EmptyState otherwise. - global.css: .tiling-ws-layer (+ .inactive). - preload.ts: ipcRenderer.setMaxListeners(2000) - per-terminal IPC listeners now scale with the total number of terminals across all workspaces. - tests/e2e/workspaces.spec.ts: regression test asserting inactive-workspace panes stay mounted across a switch. Closes TASK-240. Follow-up TASK-241 filed for floating panels in inactive workspaces (Option B scoped to tiled panes). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Switching workspaces rendered a single
<TilingLayout/>bound to the active workspace'slayout.tilingRoot, so the previous workspace'sTerminalPanels unmounted and their xterm instances were disposed. PTY output produced while a workspace was hidden was dropped, and the pane came back blank/stale until a manual resize fired SIGWINCH and the running app (e.g. Copilot CLI) redrew.Issue :

After switching worksapce :
After switching workspace and re-sizing (force rendering) the tabs :
Fix
Render every workspace's tiling tree as a stacked, absolutely-positioned layer in
.layout-area(active visible, inactivevisibility:hiddenbut still sized and rendering) and mount portals for all terminals via the existing TASK-158 host system. Each xterm keeps consuming its PTY while hidden, so switching back is instant and current — no resize, nothing lost.Changes
TilingLayout.tsx— per-workspace stacked layers; portals + host GC over all terminals; active-empty layer showsSessionLoadingwhile restoring (preserves the TASK-117 no-empty-state-flash) /EmptyStateotherwise.global.css—.tiling-ws-layer(+.inactive).preload.ts—ipcRenderer.setMaxListeners(2000); per-terminal IPC listeners (pty:data/pty:exit) now scale with the total terminal count across all workspaces.tests/e2e/workspaces.spec.ts— regression test asserting inactive-workspace panes stay mounted across a switch (fails on the old code).Testing
out-e2e/tmax-win32-x64/tmax.exe), so it can't run on macOS locally. New test + changed sources confirmed to parse via esbuild; existing single-workspace specs use>= Npanel-count assertions and class selectors, so the extra layer wrapper doesn't affect them.Notes