Skip to content

fix(sidebar): keep project name visible on pinned worktree rows - #13572

Open
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/13353-pinned-project-name
Open

fix(sidebar): keep project name visible on pinned worktree rows#13572
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/13353-pinned-project-name

Conversation

@bbingz

@bbingz bbingz commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Pinning moves a worktree into the Pinned section without the project group header, so project identity was only an icon + aria-label/tooltip.
  • Show a visible project name chip when the card title is a worktree/branch label (not when the title is already the project name).
  • Fall back blank card titles through resolveWorktreeDisplayName so cleared/nullish display names do not leave an empty row.

Test plan

  • pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx
  • Manual: pin a feature worktree → project name + worktree title both readable; pin primary named after project → no duplicate chip

Fixes #13353

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@bbingz, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 57 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: becb3fd0-2c90-4f4a-a840-20fbfa4a709e

📥 Commits

Reviewing files that changed from the base of the PR and between 4c69e45 and d20f71b.

📒 Files selected for processing (4)
  • src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx
  • src/renderer/src/components/sidebar/use-worktree-card-linked-details.ts
  • src/renderer/src/components/sidebar/worktree-card-header.tsx
  • src/renderer/src/components/sidebar/worktree-card-presentation.tsx
📝 Walkthrough

Walkthrough

Worktree cards now fall back to resolveWorktreeDisplayName when the selected title is blank or whitespace-only. Pinned cards derive a trimmed repository name and expose it when it differs from the visible card title. WorktreeCardHeader renders the project name as a truncated accessible label. Tests cover project-name display, duplicate suppression, and branch-name fallback.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description includes a useful summary and test plan but omits the required Screenshots, AI Review Report, Security Audit, and Notes sections. Add all required template sections, including screenshot status, complete testing results, AI review and cross-platform checks, security audit, and notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: keeping the project name visible on pinned worktree rows.
Linked Issues check ✅ Passed The implementation addresses [#13353] by showing project names on pinned rows, avoiding duplicate names, and falling back for blank titles.
Out of Scope Changes check ✅ Passed The implementation and tests remain focused on pinned sidebar row naming and the linked issue requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

@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

🧹 Nitpick comments (2)
src/renderer/src/components/sidebar/WorktreeCard.tsx (1)

1451-1458: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the documented sidebar label tokens.

This new label adds raw max-w-[7rem], text-[12px], and leading-5 values. Use the documented renderer tokens, or the existing sidebar truncation component when it provides the required behavior.

As per coding guidelines, renderer UI work must follow docs/STYLEGUIDE.md and use tokens from src/renderer/src/assets/main.css.

Source: Coding guidelines

src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx (1)

129-131: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression cases for blank and nullish titles.

These assertions use a non-empty displayName. They do not exercise the fallback at WorktreeCard.tsx Lines [641-647]. Add cases for empty and nullish displayName values, then assert that the branch or path name remains visible in a pinned row.

Based on the PR objective, blank and nullish card titles must retain a readable project/worktree name.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6ee4f83b-0e55-4772-84de-f439bdd6ac03

📥 Commits

Reviewing files that changed from the base of the PR and between a63df91 and 1edce0b42c517f47dad65e1a367b64ac2c56378b.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx

Comment thread src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx Outdated

@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: Pro Plus

Run ID: 858f4ee1-f184-470d-86e4-e7ace7c943a3

📥 Commits

Reviewing files that changed from the base of the PR and between 1edce0b42c517f47dad65e1a367b64ac2c56378b and 3b0a0e54f9000b73a218188d1727f92f138bd96b.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx
  • src/renderer/src/components/sidebar/WorktreeCard.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/sidebar/WorktreeCard.tsx

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@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.

🧹 Nitpick comments (1)
src/renderer/src/components/sidebar/worktree-card-header.tsx (1)

107-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Verify the new label uses approved design tokens.

Confirm that max-w-[7rem] and text-[12px] are approved by docs/STYLEGUIDE.md. If they are not approved tokens, replace them with the corresponding values from src/renderer/src/assets/main.css.

As per coding guidelines, UI work in this path must follow docs/STYLEGUIDE.md and use tokens from src/renderer/src/assets/main.css.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1995f0c1-2386-4bda-8bb4-3337998f73e6

📥 Commits

Reviewing files that changed from the base of the PR and between 9f8c22c and 73b6e88da517cf3235964b7ba09d1dc011ef93de.

📒 Files selected for processing (4)
  • src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx
  • src/renderer/src/components/sidebar/use-worktree-card-linked-details.ts
  • src/renderer/src/components/sidebar/worktree-card-header.tsx
  • src/renderer/src/components/sidebar/worktree-card-presentation.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/sidebar/WorktreeCard.pinned-repo-icon.test.tsx

@bbingz

bbingz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Ready for review (contributor priority pack)

  • Rebased / checked against current main where needed
  • Scoped bugfix; summary + test plan in the description
  • Community PR: please Approve and run workflows when convenient (fork CI stays off)
  • No maintainer merge expected from us — happy to iterate on review comments

Part of a short priority list for maintainers: P0 #13609 #13566 · hot #13710 #13692 #13691 #13536 #13572 #8072 #13237 · easy #13570 #13561 #13255.

Pinned rows leave the project group header, so only an icon with an
aria-label remained for project identity. Show a readable project name
next to the icon when the card title is a worktree/branch label, and fall
back empty titles through resolveWorktreeDisplayName.

Fixes stablyai#13353
@bbingz
bbingz force-pushed the fix/13353-pinned-project-name branch from 73b6e88 to d20f71b Compare August 11, 2026 19:26
@nwparker nwparker removed the P1 label Aug 19, 2026
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.

Pinned worktree/project row may hide project name in sidebar

4 participants