Skip to content

Add preference to show pinned worktrees in original lists - #6216

Merged
brennanb2025 merged 12 commits into
mainfrom
brennanb2025/fix-pin-duplication
Jul 17, 2026
Merged

brennanb2025 merged 12 commits into
mainfrom
brennanb2025/fix-pin-duplication

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a default-off Appearance -> Sidebar setting, Also show pinned worktrees in groups, for users who want pinned worktrees to remain visible in their natural All/Project/Status/PR groups. With the default setting off, pinned worktrees render only in the dedicated Pinned section. With the setting on, pinned worktrees remain in Pinned and also render in their natural groups.

The sidebar logic now threads an explicit pinned-display policy through row construction, active/reveal/navigation behavior, sleep anchoring, host section metadata, activity summaries, drag metadata, and imported-worktree fallback placement so both modes stay internally consistent.

Design Review

  • Design doc was created as scratch context at .tmp/pinned-worktrees-setting-design.md and kept out of the product diff.
  • Delegated design review completed clean after iterations.
  • No agent prompt text was changed; the only new user-visible text is settings/search UI copy and locale catalog entries.

Implementation Notes

  • Added showPinnedWorktreesInGroups to global settings with default false.
  • Added the Appearance -> Sidebar switch, settings-search catalog entry, and localized strings.
  • Added single-location vs duplicate-in-groups policy handling for sidebar rows.
  • Kept reveal, aria active descendant, keyboard navigation, sleep anchoring, activity badges, host collapsed counts, and drag/reorder metadata aligned with the selected policy.
  • Follow-up CodeRabbit fix made host metadata prefer Worktree.hostId for runtime/project-host worktrees and documented the row-key/pinned-row preference contracts.
  • Follow-up copy polish changed the label to “Also show pinned worktrees in groups” and tightened the row’s bottom padding.

Security Audit

  • No auth, token, secret, provider, network, shell execution, or external side-effect behavior changed.
  • No agent prompt text or product-authored workflow instructions were added.
  • The new setting is local UI state and only affects sidebar rendering/selection metadata.
  • SSH/remoting transport was not changed; host metadata paths were reviewed for SSH/runtime host correctness.

AI Review Report

  • Delegated reviewers checked the diff for correctness, accessibility, state consistency, SSH/remoting assumptions, localization, and agent-instruction boundaries.
  • Cross-platform review: no keyboard shortcuts, shortcut labels, filesystem path handling, shell behavior, platform-specific Electron APIs, or OS-specific UI behavior were introduced.
  • The changed UI uses existing settings primitives and tokenized styling; no hardcoded platform assumptions were added.
  • CodeRabbit comments were addressed, then refreshed CodeRabbit reviews reported no actionable comments.

Completeness Verification

  • Delegated implementation-completeness verification eventually confirmed complete against the design doc after fixes for host-local collapsed headers, activity wiring, project-group activity, reveal project grouping, pinned drag metadata, and Project Group activity badges.

Code Review Loop

  • Round 1 found pinned drag metadata and collapsed-host reveal issues; both fixed.
  • Round 2 found drag session group/unit metadata was incomplete; fixed.
  • Round 3 found Project Group headers missed activity badge metadata; fixed.
  • Round 4 returned clean from both reviewers.
  • Final post-validation review caught untranslated non-English locale fallbacks; fixed.
  • Final translated-locale review returned clean from both reviewers.

Brennan Test Changes

Verdict: land.

Electron validation launched this exact worktree/branch, used a disposable demo-project target, and exercised the real Settings -> Appearance -> Sidebar switch. Evidence:

  • Default/off: pinned worktree appeared only under Pinned; All showed only the unpinned demo worktree.
  • On: DOM showed the pinned worktree in both sectionKey: pinned and sectionKey: all.
  • Backing state changed to settings.showPinnedWorktreesInGroups: true when toggled.
  • Console had 0 feature-related errors; non-blocking dev-environment noise was noted.
  • Cleanup restored the setting, removed temp demo data, and stopped the Electron process started for validation.

Screenshots:

  • /tmp/orca-batfish-validation-20260623-163130/sidebar-setting-off.png
  • /tmp/orca-batfish-validation-20260623-163130/settings-appearance-sidebar-switch-off.png
  • /tmp/orca-batfish-validation-20260623-163130/settings-appearance-sidebar-switch-on.png
  • /tmp/orca-batfish-validation-20260623-163130/sidebar-setting-on.png

Accepted gaps:

  • Electron was not rerun after localization-only, test-timeout-only, CodeRabbit metadata/comment fixes, and copy/padding polish; accepted because runtime setting/sidebar behavior was unchanged after the Electron pass.
  • No live SSH pass was run; accepted because this changes host grouping metadata, not SSH/remoting transport behavior.

Checks

  • pnpm run lint
  • pnpm run typecheck
  • pnpm run typecheck:web
  • Focused suite: pnpm test src/renderer/src/components/sidebar/worktree-list-groups.test.ts src/renderer/src/components/sidebar/worktree-section-activity.test.ts src/renderer/src/components/sidebar/host-section-rows.test.ts src/renderer/src/components/sidebar/sleep-worktree-flow.test.ts src/renderer/src/components/sidebar/WorktreeList.lineage-child-card.test.ts src/renderer/src/components/sidebar/worktree-list-imported-rows.test.ts src/renderer/src/components/sidebar/worktree-drag-units.test.ts src/renderer/src/components/settings/terminal-search.test.ts
  • CodeRabbit follow-up focused suite: pnpm test src/renderer/src/components/sidebar/worktree-list-groups.test.ts src/renderer/src/components/sidebar/sleep-worktree-flow.test.ts src/renderer/src/components/sidebar/WorktreeList.lineage-child-card.test.ts
  • Copy/layout follow-up checks: pnpm test src/renderer/src/components/settings/terminal-search.test.ts, touched-file oxlint, pnpm run verify:localization-catalog, pnpm run verify:localization-coverage, pnpm run typecheck:web
  • git diff --check
  • Max-lines-disable guard: no matches

Post-PR Stabilization

Complete.

  • Initial PR checks: verify and track-community-pr passed.
  • CodeRabbit posted 3 actionable inline comments; all were addressed in 64a1a6487.
  • After follow-up pushes, required 8-minute waits were completed.
  • Refreshed CodeRabbit summaries: no actionable comments generated in the recent reviews; previous inline comments are marked addressed.
  • Refreshed PR check passed for the latest copy/padding polish commit.
  • Remaining CodeRabbit docstring-coverage warning appears repo-wide/non-actionable for this PR and does not block GitHub checks.

Notes

  • PR intentionally remains unmerged.
  • Scratch design/review context remains out of the product diff.
  • No known product risks remain beyond the accepted validation gaps above.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds showPinnedWorktreesInGroups, a boolean setting defaulting to false, and wires it into the Appearance settings UI and search catalog. Sidebar grouping now uses a pinned-display policy to decide whether pinned worktrees stay only in the Pinned section or also appear in other groups. Section headers now carry host-scoped running counts, and WorktreeList uses the new policy for rendering, navigation, reveal, and drag behavior. Host-section row handling, sleep-flow option lookup, and related tests were updated to match the new pinned-row behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description covers summary, testing, security, notes, and AI review details, though it doesn’t follow the template exactly.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly matches the main change: a new preference controlling whether pinned worktrees appear in their original groups.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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: 3


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a5915f73-3eb9-467c-8787-328b709e0029

📥 Commits

Reviewing files that changed from the base of the PR and between e03a1cf and 92bede6.

📒 Files selected for processing (23)
  • src/renderer/src/components/settings/AppearancePane.tsx
  • src/renderer/src/components/settings/appearance-sidebar-search.ts
  • src/renderer/src/components/settings/terminal-search.test.ts
  • src/renderer/src/components/sidebar/WorktreeList.lineage-child-card.test.ts
  • src/renderer/src/components/sidebar/WorktreeList.tsx
  • src/renderer/src/components/sidebar/host-section-rows.test.ts
  • src/renderer/src/components/sidebar/host-section-rows.ts
  • src/renderer/src/components/sidebar/sleep-worktree-flow.test.ts
  • src/renderer/src/components/sidebar/sleep-worktree-flow.ts
  • src/renderer/src/components/sidebar/worktree-drag-units.test.ts
  • src/renderer/src/components/sidebar/worktree-drag-units.ts
  • src/renderer/src/components/sidebar/worktree-list-groups.test.ts
  • src/renderer/src/components/sidebar/worktree-list-groups.ts
  • src/renderer/src/components/sidebar/worktree-list-imported-rows.test.ts
  • src/renderer/src/components/sidebar/worktree-section-activity.test.ts
  • src/renderer/src/components/sidebar/worktree-section-activity.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
  • src/shared/constants.ts
  • src/shared/types.ts

@brennanb2025 brennanb2025 changed the title Add preference for pinned worktree group display Add preference to show pinned worktrees in original lists Jun 24, 2026
Resolve conflicts from ~1500 commits of main drift:
- AppearancePane: take main's refactored section structure; relocate the
  'Also show pinned worktrees in their original lists' toggle into
  AppearanceWindowSidebarSection where main moved the sibling sidebar toggles.
- SettingsFormControls: keep main's description-conditional row padding plus
  the PR's optional className passthrough.
- worktree-list-groups.ts: restore main's visiblePinnedRepoIds declaration
  dropped by the auto-merge (still used by main's external-inbox repo loop).
- worktree-list-groups.test.ts: interleaved test blocks reassembled; realign
  one buildRows call for main's new newExternalWorktreesInboxByRepo parameter.
- locale catalogs: keep main's keys, add the pinned-setting strings (all 5).

Verified: typecheck:web, localization catalog+coverage, 174 sidebar tests,
57 settings tests, oxlint on touched files — all green.
@brennanb2025
brennanb2025 merged commit c5d2275 into main Jul 17, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
)

* Add setting for pinned worktree group display

Co-authored-by: Orca <[email protected]>

* Fix pinned worktree host metadata

Co-authored-by: Orca <[email protected]>

* Polish pinned worktree setting copy

Co-authored-by: Orca <[email protected]>

* Clarify pinned worktree setting copy

Co-authored-by: Orca <[email protected]>

* Use original lists in pinned setting copy

Co-authored-by: Orca <[email protected]>

* Fix pinned sidebar order and render churn

* Fix pinned host and inbox placement

* Fix worktree host ownership consistency

---------

Co-authored-by: Orca <[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.

1 participant