Skip to content

Keep project names short and show their machine - #28250

Merged
nwparker merged 7 commits into
mainfrom
nwparker/scan-project-host-labels
Oct 20, 2026
Merged

nwparker merged 7 commits into
mainfrom
nwparker/scan-project-host-labels

Conversation

@nwparker

@nwparker nwparker commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 5 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​600 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​592
Prod 11 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​434 $\color{#cf222e}{\Huge{\mathbf{−}}}$​182 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​252

ELI5

Projects called app on different computers keep their short names. In a view containing multiple machines, a small machine icon and name sit beside each project header, including when its workspaces are collapsed.

What Changed

The name generator distinguishes same-name projects within each execution host, so a project on another computer cannot make a short name expand to a full path.

Project headers now show a plain host icon and name using the existing machine identities and user-defined labels. The label stays visible when workspace cards are compact or their host property is hidden. Ordinary single-host sidebars and explicit host sections avoid repeated machine labels. A logical project spanning multiple machines never claims a single machine owns all its workspaces.

The header keeps the existing folder/project icon, aligns its contents, and reserves space for hover actions so they cannot cover host text. Long labels truncate, with full context available from the existing tooltip behavior.

Why

A machine icon alone cannot distinguish two remote Macs. Icon plus name supplies that context while keeping the project name readable, and follows the existing run-target picker style. Keeping this display change in the sidebar reuses existing machine identities and avoids changing the remote protocol.

Thanks to @KAPUIST for the community diagnosis and regression cases; their existing co-author credit is preserved.

Linked Issue

Fixes #27700

Visual Proof

These are actual sidebar captures from a hidden macOS Electron renderer, using identical seeded data and Orca’s standard gray folder icon. Before is the integrated PR before the header follow-up; it already has short app names, but collapsed headers have no visible machine identity. After implements approved design A.

Before: collapsed, no machine labels After: aligned icon and machine name
Before: two collapsed app headers with no host labels After: app with Local Mac and app with Home, both collapsed

The label also remains when expanded, with compact cards, or when the workspace-card host property is hidden. Workspace-card badges retain their existing appearance.

After: expanded After: dark theme, collapsed
Expanded projects retain their inline machine names Dark theme collapsed project headers retain Local Mac and Home

Narrow sidebar, 234px: long project and machine names truncate while the hover actions keep their own space. The tooltip exposes the full text and machine detail.

Long names with hover actions Full label on hover
234px sidebar: truncated labels remain beside non-overlapping header actions Full long project and machine names shown in a normally wrapped tooltip

Keyboard focus: the focused header exposes the same full project and machine label.

Focused project header with full project and host tooltip

Captured from commit 10d677a0202247c0a67f34999691dc6b62aa3285; the before state substitutes only the nine header-follow-up product modules from integrated baseline 32cb22073768f211448db6f9f60a622327011211. This is seeded UI evidence, not a live remote connection. Native windows remained hidden and unfocused.

Filtered project review follow-up

A shared project has local and Home checkouts. After filtering out Home, every listed checkout is local. The old version still showed unnecessary Local Mac metadata beside Local tools; the fix removes it. Global ownership remains intact, so Shared app does not claim a single machine owns it.

Before: filtered, collapsed (10d677a) After: filtered, collapsed (117c4d7)
Before: hidden remote checkout leaves redundant Local Mac label After: local-only view omits redundant machine labels

Clearing the filter restores the Home checkout and useful machine context:

Unfiltered mixed view preserves Home workspace and Local Mac context

These captures use the actual production sidebar and its repository and host filters. Twelve hidden Electron states passed: repository-filtered, local-host-scoped, and unfiltered views, each expanded and collapsed, before and after. Data is seeded; live remote transport was not exercised.

Testing

  • 22 hidden macOS Electron layout states checked, including icon/text alignment, 240px width, card settings and host sections. Header keyboard tooltip, Enter/Space and pending text-to-action-to-text tooltip transitions passed; fresh production bundle built.
  • Earlier validation at 10d677a: 141 focused desktop/shared tests across 18 files passed: host names, aliases, logical project ownership, empty folders, same-host path disambiguation, host sections, header actions, drag behavior and sticky headers.
  • Earlier validation at 10d677a: 55 mobile tests across two files passed, including explicit desktop-parity and older-feed fallback expectations.
  • Review follow-up at 117c4d7: 92 focused tests across eight files passed, including populated/empty, expanded/collapsed, repository and host filters, aliases, and unfiltered positive controls.
  • Native Windows (awin) and Linux (omarchy): 37 exact-source ownership, path-label and grouping tests passed on each, with no skips. All 76 compiled source/test modules match final commit 117c4d7bfaa45e4e7bcdfd5bcd79df12bd51a8c0.
  • pnpm tc:web, changed-code quality (zero findings), lint/format and commit hooks passed.
  • Windows/Linux Electron UI and live SSH or paired-host execution were not exercised. UI captures use seeded data in a hidden macOS renderer. The capture did not establish ellipsis keyboard-tooltip/menu behavior: its keyboard tooltip was absent, and a final duplicate menu probe could not target hidden controls. Those capture limits are not counted as passing UI checks.

CI is green on final commit 117c4d7bfaa45e4e7bcdfd5bcd79df12bd51a8c0: 19 successful checks, 18 skipped by workflow selection, zero failed or pending. Static analysis/typecheck, all five unit-test shards, mobile verification/web bundle, relay checks, macOS/Windows packaging, WSL and evidence aggregators pass. E2E and layout-oracle were skipped by policy and were not executed. No retries were needed. The latest bot review covers this commit with zero actionable findings; the filtered-project review thread is resolved. This PR remains open for review.

Review

Root and independent source reviews found no remaining correctness blocker. Actual 240px rendering exposed host text over-shrinking behind a long project name; retaining its bounded width fixes that case. The existing folder icon remains, and project/host icons and text use the same vertical alignment.

A logical project spanning multiple machines receives no misleading single-machine label. The sidebar uses its existing filtered section membership to decide whether more than one machine is visible, including while collapsed. Filtering out a remote checkout therefore removes unnecessary machine labels from the remaining local projects. Global project ownership stays separate, so a shared project never acquires a misleading single-machine label. Existing identical custom machine names remain identical, with host detail available in the tooltip; this PR does not introduce a new app-wide naming policy.

Keyboard focus and pointer hover expose the full header identity. Regression tests cover nested action focus, hover, pending tooltip cancellation, and returning to project text. Existing listing host options supply the labels without adding a selected-server read; authoritative host aliases are preserved.

This PR remains open for review.

Agent skill upstream boundary

  • Not applicable: no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation copied or translated.

Notes

Extra host metadata uses some horizontal space in mixed-host project views. Long names can truncate; the full label remains available. Existing same-host path disambiguation remains in effect. This PR does not change host execution, status ownership, persistence, Git commands, provider support, or remote wire contracts.

Checklist

  • Explained ELI5, user-facing before/after, mechanism and approach
  • Before/after captures attached
  • Self-reviewed and independently reviewed
  • Cross-platform, SSH identity and folder-workspace impact considered; live UI limits listed above
  • Focused tests, typecheck and changed-code gates pass
  • Current CI recorded

Only add parent path segments when project names collide on the same host. Reuse execution host normalization and keep existing label-map keys and path disambiguation rules unchanged.

Co-authored-by: KAPUIST <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 585da002-aa32-4dbc-a19e-40d6b4874140
📥 Commits

Reviewing files that changed from the base of the PR and between 10d677a and 117c4d7.

📒 Files selected for processing: 5
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.test.ts
  • src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.ts
  • src/renderer/src/components/sidebar/worktree-list/viewport/VirtualizedWorktreeViewport.tsx
  • src/renderer/src/components/sidebar/worktree-list/viewport/viewport-props.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Repository display-name collisions are now scoped by execution host. The sidebar derives host context for project headers and renders host labels and tooltips when multiple hosts are visible. Regression tests cover host-scoped labels, host aliases, tooltip interactions, and identical project paths across local and paired hosts.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 117c4

The previously reported misleading host labels are addressed on the production sidebar path. No actionable merge-blocking risk remains in the supplied evidence.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 27.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 16 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly summarizes both main changes: preserving short project names and displaying their host machine.
Linked Issues check Passed Issue #27700 requires same-path projects on different execution hosts to keep the short project name and use host context to distinguish them. getRepoDisplayLabelsByPath now separates collision grou…
Out of Scope Changes check Passed The production changes support issue #27700 and the linked PR objectives. Header layout, truncation, tooltip, accessibility, and hover-action handling support the added host context. Test and fixture …
Description check Passed The pull request description is complete and follows the repository template. It explains the change and rationale, links issue #27700, provides visual proof, documents testing and known limits, recor…
Full details: Linked Issues check

Explanation

Issue #27700 requires same-path projects on different execution hosts to keep the short project name and use host context to distinguish them. getRepoDisplayLabelsByPath now separates collision groups by execution host. getProjectHeaderHostContexts and the header components show existing host identity and labels, including collapsed headers, while suppressing redundant single-host labels and avoiding a single-host claim for multi-host projects. Focused tests cover cross-host labels, aliases, filtering, host sections, multi-host projects, and tooltip behavior.

Full details: Out of Scope Changes check

Explanation

The production changes support issue #27700 and the linked PR objectives. Header layout, truncation, tooltip, accessibility, and hover-action handling support the added host context. Test and fixture updates validate the changed label behavior across desktop, mobile, and host variants. No unrelated product feature, execution behavior, persistence change, or remote protocol change is shown.

Full details: Description check

Explanation

The pull request description is complete and follows the repository template. It explains the change and rationale, links issue #27700, provides visual proof, documents testing and known limits, records review notes, addresses cross-platform and compatibility concerns, and includes checklist status. The AI Disclosure section is appropriately left blank when the contributor is an internal team member.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

nwparker and others added 4 commits October 19, 2026 22:48
Show quiet inline host icons and names on host-owned project headers in mixed-host sidebars. Reuse the host registry and omit redundant context under host sections or on logical projects spanning multiple hosts.

Co-authored-by: KAPUIST <[email protected]>
Keep the host label at its bounded width so long project names cannot shrink it below the host icon.

Co-authored-by: KAPUIST <[email protected]>
Keep full project and host names readable without splitting words in the header tooltip.

Co-authored-by: KAPUIST <[email protected]>
@nwparker nwparker changed the title Keep project names short across execution hosts Keep project names short and show their machine Oct 20, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 820d0057-1d6d-4079-857f-a1fdb74f111c
📥 Commits

Reviewing files that changed from the base of the PR and between ba6599e and 0ea66a6.

📒 Files selected for processing: 9
  • src/renderer/src/components/sidebar/worktree-list-groups-host-name-collisions.test.ts
  • src/renderer/src/components/sidebar/worktree-list/rows/ProjectHeaderHostLabel.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/SectionHeader.tsx
  • src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.test.ts
  • src/renderer/src/components/sidebar/worktree-list/rows/project-header-host-context.ts
  • src/renderer/src/components/sidebar/worktree-list/viewport/VirtualizedWorktreeViewport.tsx
  • src/renderer/src/components/sidebar/worktree-list/viewport/virtual-row-context.ts
  • src/shared/repo-display-labels.test.ts
  • src/shared/repo-display-labels.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

nwparker and others added 2 commits October 19, 2026 23:17
Reuse listing host options without reading the selected host, keep authoritative host aliases, and preserve child action tooltips. Update cross-host parity expectations for host-local project names.

Co-authored-by: KAPUIST <[email protected]>
Reuse the row plan membership before collapse so hidden checkouts do not add redundant host labels to a filtered sidebar. Keep full project ownership when deciding whether a header can claim one host.

Co-authored-by: KAPUIST <[email protected]>
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.

[Bug]: Sidebar project headers show the full path when two hosts share a project path

1 participant