Skip to content

fix(desktop): preserve pane layout when removing a workspace from the sidebar - #5883

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
triage/issue-5881-29943122585
Draft

github-actions[bot] wants to merge 1 commit into
mainfrom
triage/issue-5881-29943122585

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

What the bug is

Issue #5881 reports two symptoms after using Remove from Sidebar on a workspace:

  1. The "Workspaces" nav item is missing from the left sidebar.
  2. Reopening the workspace via Search → Workspaces shows it without the attached live Claude session.

This PR fixes symptom #2 (the reproducible, clearly-scoped defect). See the note below on #1.

Root cause

"Remove from Sidebar" is a headless intent consumed by RemoveFromSidebarMount, which calls hideWorkspaceInSidebar → tombstoneSidebarWorkspaceRecord. That function set isHidden = true and wiped the persisted pane layout:

draft.paneLayout = createEmptyPaneLayout(); // tabs: []

The runtime cleanup it runs (terminalRuntimeRegistry.release) is non-destructive — it persists runtime state and keeps the host-side session alive (only dispose() kills a session). So the Claude terminal keeps running; the problem is purely that its pane layout was erased.

On reopen, useV2WorkspacePaneLayout reads v2WorkspaceLocalState.paneLayout — now empty — so the workspace renders with no panes and the still-alive Claude session is orphaned. This contradicts the documented contract that unpinning is "reversible — the workspace itself is not deleted and can be re-pinned."

The fix

Stop wiping paneLayout in the tombstone's update branch. The layout is preserved, so re-pinning/reopening restores the panes and the released runtime reattaches to the live session. The row-less insert branch is unchanged (a row-less workspace has no persisted layout to keep). Runtime release still happens, so renderer resources are freed while the workspace is hidden.

Tests

sidebarMutations.test.ts gains a reproduction test asserting that hiding a workspace with a live terminal pane keeps its persisted paneLayout. It failed before the fix (layout reset to { tabs: [] }) and passes after. All 25 nearby sidebar tests pass; bun run lint is clean.

Note on symptom #1 (nav item missing)

The top-level "Workspaces" nav item is gated behind a hardcoded flag in DashboardSidebarHeader.tsx:

// Temporarily hidden, not removed — flip to true to restore the Workspaces tab.
const SHOW_WORKSPACES_TAB = false;

It is unconditionally hidden in this version and is not affected by "Remove from Sidebar", so it looks like a deliberate product decision rather than a bug. Left untouched here pending product intent — flipping it is a one-line change if desired.

Closes #5881


Summary by cubic

Preserves a workspace’s pane layout when using Remove from Sidebar so reopening or re‑pinning restores panes and reattaches the live Claude session. Addresses the reproducible part of #5881.

  • Bug Fixes
    • Stop clearing paneLayout in tombstoneSidebarWorkspaceRecord; only release renderer runtimes so host sessions persist for reattach.
    • Add a test in sidebarMutations.test.ts to assert the layout is preserved when hiding a workspace.

Written for commit 3488c8f. Summary will update on new commits.

Review in cubic

@MacKevinroe

Copy link
Copy Markdown

Removing the Workspaces nav item can't possibly be an intended product change. It makes it incredibly cumbersome to find and pin workspaces to the sidebar, and difficult to view headless and unpinned workspaces. Surely, you jest, actionsbot.

zachjxyz pushed a commit to zachjxyz/superset that referenced this pull request Jul 25, 2026
…e fix (ParadevAI#4893)

* improvement(ParadevAIGH-3572): capture brief

* improvement(ParadevAIGH-3572): scope proposal v1

* improvement(ParadevAIGH-3572): scope challenged + user pushback note

* improvement(ParadevAIGH-3572): deep-research findings (PR ParadevAI#5883 + beta.220)

* fix(desktop): bump @xterm/* to beta.220 for upstream WebGL atlas-merge fix

Picks up xtermjs/xterm.js#5883 "Fix webgl rendering corruption from atlas
page merges" (merged 2026-05-21 by Tyriar). The PR fixes two atlas-merge
bugs that match the reported symptom in ParadevAI#3572 (and the sibling cluster
ParadevAI#3527, ParadevAI#3794, ParadevAI#4601, ParadevAI#4639): texture binding stays bound to the old page's
canvas after a same-index page swap during merge, so glyphs sample garbage.

Maintainer Tyriar on the PR: "This has been an issue for a long time, I
think it's popped up more recently due to agentic CLIs using a much wider
range of character styles."

Also adds a one-line VSCode-pattern (microsoft/vscode#120393) fallback
inside both onContextLoss handlers: set the module-local
suggestedRendererType = "dom" so subsequent terminals on the same path
avoid WebGL after a context-loss event. Defense-in-depth for the rarer
GPU-process-death class that bypasses the upstream atlas-merge fix.

Refs ParadevAI#3572

* improvement(ParadevAIGH-3572): bind scope to option α (upstream bump + fallback)

* fix(web): align @xterm/* to beta.220 (matches desktop)

* chore(ParadevAIGH-3572): remove orchestration artifacts before PR push

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Workspaces nav item missing from left sidebar

1 participant