Skip to content

Show "Except default branch" filter only when "Hide sleeping" is on - #12460

Merged
nwparker merged 2 commits into
mainfrom
nwparker/hide-sleeping-except-default-branch
Aug 4, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/hide-sleeping-except-default-branch

Conversation

@nwparker

@nwparker nwparker commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The Except default branch sub-toggle sat permanently under Hide sleeping in both workspace filter surfaces, even though the exemption only does anything during the hide-sleeping sweep (computeVisibleWorktreeIds applies it inside the !showSleepingWorkspaces branch). It now renders only once the parent Hide sleeping toggle is ticked.

Two follow-ons fall out of that:

  • The filter badge follows the same rule — a hidden, no-op exemption no longer inflates the active-filter count in either menu.
  • The row's indent was silently broken: Tailwind v4 emits px-2 as padding-inline, which outranks the physical pl-6 override, so the sub-option rendered flush with its siblings (measured 8px, same as every other row). Splitting the base padding restores the nesting.

Visual proof

Captured from the dev build over CDP (workspace options menu, same instance, HMR-swapped between the old and new components).

Before — Hide sleeping off After — Hide sleeping off After — Hide sleeping on
before: exemption row always shown, flush with its siblings after: exemption row hidden after: exemption row appears indented under its parent
Row is visible, switched on, with nothing to act on — and reads as a sibling, not a sub-option. Row is gone; the list starts at Hide default branch. Row returns indented under its parent, and the badge counts 1.

Changes

  • SidebarFilter.tsx / SidebarWorkspaceFilterSection.tsx: gate the indented exemption row on !showSleepingWorkspaces.
  • visible-worktrees.ts: new shared isSleepingSweepExemptionNarrowingList predicate so the two badge counters can't drift.
  • SidebarFilter.tsx / SidebarWorkspaceOptionsMenu.tsx: count the exemption only when it actually narrows the list.
  • FilterToggleRow.tsx: py-1.5 pr-2 + pl-7/pl-2 instead of px-2 + pl-6, so the sub-option indent survives Tailwind v4's logical-property cascade (verified 28px vs 8px in the running app).
  • Persisted state is untouched — flipping Hide sleeping off and back on restores the user's exemption choice.

Testing

  • SidebarWorkspaceFilterSection.test.tsx (new): row hidden while sleeping shown, visible once hide-sleeping is on, still hidden when opted out with sleeping shown.
  • FilterToggleRow.test.tsx (new): the indented row keeps a left-padding utility and never pairs it with a px-* that would outrank it.
  • sidebar-filter-state.test.ts: unit coverage for the new predicate.
  • vitest run on the sidebar filter suites — 45 passed.
  • tsc --noEmit -p config/tsconfig.tc.web.json + oxlint clean.

The exemption only takes effect during the hide-sleeping sweep, so its row
now renders (and counts toward the filter badge) only while its parent
toggle is ticked.

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

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

Next review available in: 7 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: ab0d6edf-238c-45bc-8191-7a89b26c02d1

📥 Commits

Reviewing files that changed from the base of the PR and between 4de70b0 and d7d55c8.

📒 Files selected for processing (2)
  • src/renderer/src/components/sidebar/FilterToggleRow.test.tsx
  • src/renderer/src/components/sidebar/FilterToggleRow.tsx
📝 Walkthrough

Walkthrough

The sidebar now treats the default-branch exemption as active only when sleeping workspaces are hidden. The exemption control is rendered only in that state. Filter badges and active counts use the same condition. Unit and component tests cover the predicate and control visibility across relevant workspace and toggle states.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ⚠️ Warning The description explains the change, visual behavior, implementation, and testing, but it omits the required AI Review Report, Security Audit, and Notes sections. Add the required AI Review Report, Security Audit, and Notes sections, including cross-platform review confirmation and any security or follow-up findings.
✅ Passed checks (3 passed)
Check name Status Explanation
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 summarizes the primary UI change: showing the “Except default branch” filter only when “Hide sleeping” is enabled.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

🧹 Nitpick comments (2)
src/renderer/src/components/sidebar/visible-worktrees.ts (1)

57-61: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the repeated explanatory comments.

The predicate name, test names, and render conditions state this behavior. Keep one concise comment only if a non-obvious product rule requires it.

  • src/renderer/src/components/sidebar/visible-worktrees.ts#L57-L61: Remove or reduce the helper description to one concise sentence.
  • src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx#L41-L42: Remove the repeated JSX gating comment.
  • src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx#L3-L6: Remove the file-level explanation.
  • src/renderer/src/components/sidebar/SidebarFilter.tsx#L115-L116: Remove the repeated active-count explanation.
  • src/renderer/src/components/sidebar/SidebarFilter.tsx#L229-L230: Remove the repeated JSX gating comment.
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx#L83-L84: Remove the repeated active-count explanation.

As per coding guidelines, comments must be concise, limited to non-obvious information, and should not explain obvious behavior.

Source: Coding guidelines

src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx (1)

75-85: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover the opted-out active state.

Line 75 only verifies visibility while alwaysShowDefaultBranchWorkspace is true. Add a case with showSleepingWorkspaces: false and alwaysShowDefaultBranchWorkspace: false. This prevents a regression that hides the control when users need it to restore the exemption.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f0bfa22e-06a3-4e3f-b205-42a745104853

📥 Commits

Reviewing files that changed from the base of the PR and between c498d2d and 4de70b0.

📒 Files selected for processing (6)
  • src/renderer/src/components/sidebar/SidebarFilter.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsx
  • src/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsx
  • src/renderer/src/components/sidebar/sidebar-filter-state.test.ts
  • src/renderer/src/components/sidebar/visible-worktrees.ts

Tailwind v4 emits px-2 as padding-inline, which outranks the physical pl-6
override, so the indented row rendered flush with its siblings. Split the
base padding so the indent actually applies.

Co-authored-by: Orca <[email protected]>
@nwparker
nwparker merged commit 5f9a5b8 into main Aug 4, 2026
42 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#12460)

* Show the "Except default branch" filter only when "Hide sleeping" is on

The exemption only takes effect during the hide-sleeping sweep, so its row
now renders (and counts toward the filter badge) only while its parent
toggle is ticked.

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

* Restore the sub-option indent on filter toggle rows

Tailwind v4 emits px-2 as padding-inline, which outranks the physical pl-6
override, so the indented row rendered flush with its siblings. Split the
base padding so the indent actually applies.

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

---------

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