Repository navigation
fix(site/src/pages/AgentsPage): preserve right panel tab state across switches - #23737
Merged
Merged
Conversation
…tches Render all tab panels simultaneously in SidebarTabView, hiding inactive ones with `display: none` (Tailwind's `hidden`) plus `inert` to block focus. Previously only the active tab's content was in the DOM; switching between Git and Desktop unmounted the inactive panel, losing scroll position, expanded file sections, commit message drafts, and tearing down the Desktop VNC connection. The VNC connection in DesktopPanel already has a ResizeObserver that handles canvas rescaling after `display: none`, so the Desktop stream stays alive across tab switches with no reconnection flicker.
React 19's types already declare inert as boolean.
Merge the desktop panel into the allPanels array instead of special-casing it separately.
DanielleMaywood
marked this pull request as ready for review
March 27, 2026 23:58
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Switching between the Git and Desktop tabs in the right panel unmounted the inactive tab, destroying scroll position, expanded file sections, commit message drafts, and tearing down the Desktop VNC connection.
Now all tab panels stay mounted. Inactive ones are hidden with
display: none(Tailwindhidden) +inertto block focus/interaction. The Desktop panel's existingResizeObserveralready handles canvas rescaling afterdisplay: none, so the VNC stream stays alive with no reconnection flicker.Design notes
We considered React 19.2's
<Activity>component, which would clean up effects on hidden panels. This is normally desirable, but the Desktop panel holds a VNC WebSocket —<Activity>would tear it down on every tab switch and force a visible reconnection cycle. The simpler CSS approach keeps the connection alive, which matches the existing code's intent (theResizeObserverworkaround inuseDesktopConnectionwas already designed fordisplay: noneancestors).