Repository navigation
fix(sidebar): activate the chosen host when a grouped workspace switches hosts - #21
Merged
Merged
Conversation
…osts Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
added a commit
that referenced
this pull request
Sep 22, 2026
…osts (#21) Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
added a commit
that referenced
this pull request
Sep 25, 2026
…osts (#21) Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
added a commit
that referenced
this pull request
Sep 27, 2026
…osts (#21) Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
added a commit
that referenced
this pull request
Sep 29, 2026
…osts (#21) Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
added a commit
that referenced
this pull request
Oct 1, 2026
…osts (#21) Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
added a commit
that referenced
this pull request
Oct 6, 2026
…osts (#21) Changing the host dropdown on a Group by branch card only updated which host the merged card rendered; the active workspace stayed on the previous host. That sibling's row is merged into the same card, so the list then showed nothing active and the card rendered unselected. Selecting a host now also activates that member's workspace, using the same path as a card click. The member is resolved by branch group key + host, because a merged row always stores its local-first member while the card can be showing any host.
nplez1
pushed a commit
that referenced
this pull request
Oct 19, 2026
…iew off the deprecated owner resolver (stablyai#30562) * refactor(renderer): fold browser creation, file actions and doc-preview callers off the deprecated owner resolver The creation-action policy and browser creation (#3, #48) fold together, so the provider the policy offers is the one creation uses. Browser panes, page lifecycle and conversion, tab duplication, the explorer tree pane, doc-preview actions and editor path moves (#21, #43, #45-#47, #49, #50) read runtimeEnvironmentIdWithLegacyFallbackUnlessTwin. File-explorer writes on a folder (#51) take the owner from the rows alone, never from the focused server. Deprecated importers 16 -> 6. * refactor(renderer): fold file preview off the deprecated owner resolver; Open in Orca Browser refuses a twin A project two hosts publish reads as no server for the doc-preview plan, but the file:// path now refuses it with its own message instead of opening this machine's copy (#7). Deprecated importers 6 -> 5. * fix(renderer): a twin's file preview and open-externally refuse instead of opening this machine's copy Codex P2 on the F7 folds: a folder twin read as no server, so the preview plan built a local file:// tab and open-externally handed the path to this machine's OS. Both now check the owner for ambiguity first. Also fix two test fixtures that broke the renderer typecheck. * refactor(renderer): move the file:// open target out of file-preview.ts file-preview.ts crossed its line limit after main grew it; the file:// target, its type and its two refusal messages move to workspace-file-browser-open-target.ts, which they never depended on file-preview for. * test: mock the replacement resolver in the quick-action availability suite (Codex P2)
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.
ELI5
When the same branch is checked out on two machines, the sidebar shows them as one card with a small dropdown to pick the machine. Picking a different machine changed what the card showed, but the app stayed "on" the old machine, so nothing in the list looked selected anymore. Now picking a machine also switches the app to that machine's copy.
What Changed
Before: with Workspaces grouped by Project and "Group by branch" on, selecting a consolidated card and then changing the host dropdown swapped the card to the new host's workspace, but the card appeared unselected. The previously active workspace — whose row is merged into that same card — had no visible selection anywhere in the list.
After: changing the dropdown makes the chosen host's workspace the active workspace, so the card stays selected and its status, branch, PR, tabs and agents follow it.
Mechanism: the dropdown only wrote the ephemeral
branchGroupHostByKeyslice field that decides which member a consolidated card renders. The host-switch path now also runs the same activation a card click uses (activateWorktreeFromSidebar(worktree.id, hostId)) plus the click-path immediate marking. The member is resolved by branch group key + host from the row'sbranchGroup, not byrow.worktree, because a merged row always stores its local-first member while the card can be displaying any host.Why
The alternative was to make the store's
setBranchGroupHostsetter activate the workspace itself. That setter is a pure state mutation shared with the tab strip, so putting activation side effects inside it is a layering problem and would also fire while state is being rehydrated. Activating on the interaction path keeps the setter pure and reuses the existing activation flow.Linked Issue
Issues are disabled in this fork, so there is no issue to link. Follow-up to the Group by branch host dropdown introduced in #14.
Related: #14
Visual Proof
N/A— reproducing needs two workspaces on the same branch on two different hosts, and the change alters selection/activation behavior rather than adding or moving any visual element. Covered by the new unit tests.Testing
pnpm test src/renderer/src/components/sidebar/worktree-list/viewport/use-branch-group-host-selection.test.ts— 4 passed (non-primary member resolves and activates with the correcthostId; host choice still recorded when the row is gone).pnpm test src/renderer/src/components/sidebar— 315 files / 2661 tests passed.pnpm tc,oxfmt --check, andpnpm run check:code-quality:changedare clean.Platforms: renderer logic only, no platform-specific code. Host switching passes the member's execution host id through the same path as a card click, so remote/SSH hosts are covered by construction.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
N/A — internal contributor.
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Security: no new inputs or data flows; the handler is a lookup over already-rendered rows. Performance: O(rows) only on dropdown click, and the returned handler stays referentially stable so memoized cards do not re-render. Cross-platform / SSH: activation goes through
activateWorktreeFromSidebarwith the member'shostId, matching the card-click path used for remote hosts.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)