Repository navigation
feat(sidebar): let the host pill be turned off per card - #24299
Merged
Merged
Conversation
Adds 'host' to the workspace-card display properties so the execution-host pill can be unchecked from Workspace options → Show properties / Card display. On by default, including a one-shot backfill for profiles persisted before the property existed, so nobody silently loses the pill. Fixes #24260
Contributor
|
This run was cancelled 🛑 The workflow was cancelled before completion. Please check the link below for details. |
|
7 of 9 tasks
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
If you use more than one machine, every workspace card in the sidebar carries a little "Local Mac" / "m4air" tag. If almost everything you work on lives on one machine, that tag is just noise that makes every card taller. Now you can switch it off.
What Changed
Before: when the visible workspaces spanned more than one execution host, every card showed a host pill in its metadata row. There was no way to turn it off, so cards got a whole extra lane of chrome that most people could not use.
After: "Host" is a normal card display property. Uncheck it in Workspace options → Show properties (or Card display on the new card style) and the pill disappears; the metadata row collapses with it when nothing else occupies it. It is checked by default, so nothing changes until you opt out.
Mechanism: the pill was rendered from a bare
!compactCards && !!hostContextLabelcheck inworktree-card-presentation.tsx.hostis now a member ofWorktreeCardProperty, part ofDEFAULT_WORKTREE_CARD_PROPERTIES, and the render check also consults the user's property list — the same mechanism that already gates Ports, Notes, Agent activity, and the rest. The menu option lists pick it up, and the RPC/web schemas derive their value domain fromWORKTREE_CARD_PROPERTIES, so they accept it automatically.Existing profiles already have a stored property array that predates
host, and the normalizer only keeps properties present in that array. Left alone, everyone would have silently lost the pill on upgrade. So there is a one-shot backfill innormalize-loaded-ui-state.tsguarded by_hostWorktreeCardPropertyDefaulted, matching thejira-issuebackfill right above it:hostis added once, and a later deliberate uncheck sticks across restarts.Why
Making it a card property rather than a new
GlobalSettingsswitch means it reuses the existing per-card display plumbing — persistence, normalization, the RPC schema, the web-client parity path, and the menu UI all already exist and already handle this shape. A separate setting would have been a parallel implementation of the same idea, and would not have lived next to the other card toggles where people already look.The one-shot backfill flag is the alternative to simply adding
hostto the defaults: defaults only apply to profiles with no stored array at all, which is almost nobody.Linked Issue
Fixes #24260
Visual Proof
Real sidebar, same workspaces, host pill on (default) and off:
The new checkbox, in the menu where the other card toggles live:
Testing
Verified in a dev build on macOS against a real multi-host profile (3 hosts, local + two remotes) over CDP: opened Workspace options → Show properties, confirmed "Host" is present and checked, unchecked it, and confirmed every host pill disappeared from the sidebar and the cards shrank. Re-checking it restored them.
Automated:
src/main/persistence-worktree-card-properties.test.ts— new cases for the one-shot backfill and for a deliberate removal surviving a restart; existing expectations updated for the new default.src/renderer/src/components/sidebar/WorktreeCard.host-badge-toggle.test.tsx— new; renders a card with a host label and asserts the pill appears withhostenabled and is absent without it.pnpm tc,pnpm run check:code-quality:changed, and the fullsrc/renderer/src/components/sidebar+src/renderer/src/i18nsuites (336 files / 2895 tests) pass.Platforms: tested on macOS. The change is pure renderer/persistence logic with no platform-dependent code paths.
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
hostonce.WorktreeCardPropertyParamis az.enumderived fromWORKTREE_CARD_PROPERTIES, so this is a new optional enum member on an existing field — safe perdocs/reference/remote-wire-compatibility.md. An older host receivinghostrejects only that value; it never sees a new opcode.Array.includesper card render.Hostlabel is added to all six locale files.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)