Repository navigation
List other connections' panes in the pane switcher with All servers - #601
Open
thiblahute wants to merge 1 commit into
Open
thiblahute wants to merge 1 commit into
thiblahute wants to merge 1 commit into
Conversation
The workspaces panel already shows every server's workspaces under All servers, but the pane switcher (Ctrl+Tab) and Pane Search (Alt+K) only knew the displayed connection's panes, plus agent panes on others for search. Reaching a shell or a workspace on another connection meant switching connections first. While All servers is selected, the store now keeps every other ready connection's topology (workspaces, tabs, panes, agents) in its sessionsByConnectionId entry, in the same shape the displayed connection keeps at the top level. Reads follow each connection's Herdr events (coalesced to one read per burst), with the metadata poll as a backstop, and stop entirely when the scope is Current. A failed read keeps the last known topology with its error rather than blanking it, since it is usually a transient reconnect, and a read is only published into the runtime generation it was issued against. The switcher lists those panes after every displayed pane, labelled with their connection: one per workspace (the one most recently used there), every pane in search. Selecting one switches to that connection, waits for its refresh and focuses the pane. Entries get a key that is unique across connections, since pane ids are only unique within one. Reading another connection needs an RPC off the active lease, so Bridge.readConnection bypasses the single-active-connection guard. It is limited to workspace.list, tab.list, pane.list and agent.list; mutating calls keep going through connection() so the isCurrent and generation checks still apply. The All servers choice moves into a small shared module so the tree, the switchers and the store read the same value in the same page. Reading and listing other connections costs about 4.5 KiB of initial JS (3.5 KiB gzipped), so the initial JS ceilings move from 833 to 837 KiB, and from 257 to 258 KiB gzipped.
This branch has not been deployed
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.
Summary
With All servers selected in the workspaces panel, the pane switcher (Ctrl+Tab) and Pane Search (Alt+K) also list the panes of every other ready connection, labelled with their connection. Selecting one switches to that connection and focuses the pane.
Why
The workspaces panel already shows every server's workspaces under All servers, but the switchers only knew the displayed connection's panes (plus agent panes on other servers in search). Reaching a shell or a workspace on another connection meant switching connections by hand first, then finding the pane.
What changed
store.ts: while All servers is on, each other ready connection's topology (workspaces, tabs, panes, agents) is kept in itssessionsByConnectionIdentry, in the same shape the displayed connection keeps at the top level. Reads follow that connection's Herdr events (one read per 150 ms burst) with the metadata poll as a backstop, run again when a connection becomes ready or reconnects into a new runtime, and stop entirely with Current. A failed read keeps the last known topology with its error instead of blanking it, and a read is only published into the runtime generation it was issued against.jumpToConnectionPaneswitches connection, waits for its refresh and focuses the pane.api.ts:Bridge.readConnectionissues a read-only RPC to a connection other than the active lease. It accepts onlyworkspace.list,tab.list,pane.listandagent.list; every mutating call still goes throughconnection()and itsisCurrent/generation checks.connectionSessions.ts(new): which connections are read, and every connection's topology in catalog order (never active-first, so a switch does not reorder the list under the pointer).paneJump.ts: other connections' panes come after every displayed pane: one per workspace in the recent switcher (the one most recently used there), every pane in search. Entries get akeyunique across connections, since pane ids are only unique within one. Search no longer adds the server agent entries of a connection it already lists in full.showAllConnections.ts(new): the All servers choice (sameagentListScopestorage key as before) as a shared value the tree, the switchers and the store read in the same page.FEATURES.md: the pane switcher and Pane Search sections.Verification
bun test web/src/connectionSessions.test.ts web/src/paneJump.test.ts web/src/store.test.ts web/src/components/WorkspaceTree.servers.test.ts web/src/components/WorkspaceTree.test.ts: 114 pass. New tests cover which connections are read, catalog order, staleness after a reconnect, the store reads (only while All servers is on, events of a replaced runtime ignored, kept on a failed read), and the switcher entries.bun run format:check,bun run lint(only the existingTerminalView.tsxwarning),bun run typecheck:bun,bun run build:web.bun run test:quickwith an isolatedHOME/TMPDIR: the only failures are the two zsh tests (no zsh here), the worktree-removal process-scan timeout, and timeouts under load that pass when rerun alone.Asset budget
Initial JS goes from 832.3 to 836.8 KiB (254.4 to 257.9 KiB gzipped), so the ceilings move from 833 to 837 KiB and from 257 to 258 KiB gzipped in
scripts/check-web-assets.mjs. The store reads and the switcher entries load with the app.Manual checks
Compatibility
No stored format change: the All servers choice keeps its
agentListScopekey and values.