Skip to content

feat(sidebar): let the host pill be turned off per card - #24299

Merged
nwparker merged 1 commit into
mainfrom
nwparker/feature-card-display-toggle-for-host
Oct 1, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/feature-card-display-toggle-for-host

Conversation

@nwparker

@nwparker nwparker commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​211 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​203
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​40 $\color{#cf222e}{\Huge{\mathbf{−}}}$​6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​34

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 && !!hostContextLabel check in worktree-card-presentation.tsx. host is now a member of WorktreeCardProperty, part of DEFAULT_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 from WORKTREE_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 in normalize-loaded-ui-state.ts guarded by _hostWorktreeCardPropertyDefaulted, matching the jira-issue backfill right above it: host is added once, and a later deliberate uncheck sticks across restarts.

Why

Making it a card property rather than a new GlobalSettings switch 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 host to 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:

before-after.png

The new checkbox, in the menu where the other card toggles live:

menu.png

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 with host enabled and is absent without it.
  • pnpm tc, pnpm run check:code-quality:changed, and the full src/renderer/src/components/sidebar + src/renderer/src/i18n suites (336 files / 2895 tests) pass.

Platforms: tested on macOS. The change is pure renderer/persistence logic with no platform-dependent code paths.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Backwards compatibility: covered by the one-shot backfill above; a profile that already unchecked other properties is untouched apart from gaining host once.
  • Remote wire: WorktreeCardPropertyParam is a z.enum derived from WORKTREE_CARD_PROPERTIES, so this is a new optional enum member on an existing field — safe per docs/reference/remote-wire-compatibility.md. An older host receiving host rejects only that value; it never sees a new opcode.
  • Mobile / SSH / performance: no new producers, no new queries, one extra Array.includes per card render.
  • i18n: the Host label is added to all six locale files.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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
@nwparker
nwparker requested a review from brennanb2025 as a code owner October 1, 2026 06:28
@pullfrog

pullfrog Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

This run was cancelled 🛑

The workflow was cancelled before completion. Please check the link below for details.

Pullfrog  | View workflow run | via Pullfrog | 𝕏

@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Adds host pill as a toggleable sidebar card property.

The PR appears safe to merge; no actionable regression was established.

Summary

The PR adds Host to workspace-card display properties, makes the pill respect that property, and backfills existing desktop profiles once so the pill remains visible by default.

  • Adds the toggle to both card-style menus and translations.
  • Adds persistence and rendering tests for the default and opt-out behavior.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Saved card properties] --> B[Load-time one-shot host backfill]
  B --> C[Renderer property list]
  D[Card display menu] --> C
  C --> E{Host enabled and label available?}
  E -->|Yes, non-compact card| F[Show host pill]
  E -->|No| G[Hide host pill]
Loading

Reviews (1) · Last reviewed commit: "feat(sidebar): let the host pill be turn..."

@nwparker
nwparker merged commit b245b3e into main Oct 1, 2026
31 of 32 checks passed
@nwparker
nwparker deleted the nwparker/feature-card-display-toggle-for-host branch October 1, 2026 06:37
@pullfrog pullfrog Bot mentioned this pull request Oct 1, 2026
7 of 9 tasks
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.

[Feature] Card Display toggle for Host

1 participant