Repository navigation
Show "Except default branch" filter only when "Hide sleeping" is on - #12460
Conversation
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]>
|
Warning Review limit reached
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 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 configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe 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)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/renderer/src/components/sidebar/visible-worktrees.ts (1)
57-61: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove 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 winCover the opted-out active state.
Line 75 only verifies visibility while
alwaysShowDefaultBranchWorkspaceis true. Add a case withshowSleepingWorkspaces: falseandalwaysShowDefaultBranchWorkspace: 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
📒 Files selected for processing (6)
src/renderer/src/components/sidebar/SidebarFilter.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.test.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceFilterSection.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/sidebar-filter-state.test.tssrc/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]>
…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]>
Summary
The
Except default branchsub-toggle sat permanently underHide sleepingin both workspace filter surfaces, even though the exemption only does anything during the hide-sleeping sweep (computeVisibleWorktreeIdsapplies it inside the!showSleepingWorkspacesbranch). It now renders only once the parentHide sleepingtoggle is ticked.Two follow-ons fall out of that:
px-2aspadding-inline, which outranks the physicalpl-6override, 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).
Hide sleepingoffHide sleepingoffHide sleepingonHide default branch.1.Changes
SidebarFilter.tsx/SidebarWorkspaceFilterSection.tsx: gate the indented exemption row on!showSleepingWorkspaces.visible-worktrees.ts: new sharedisSleepingSweepExemptionNarrowingListpredicate 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-2instead ofpx-2+pl-6, so the sub-option indent survives Tailwind v4's logical-property cascade (verified 28px vs 8px in the running app).Hide sleepingoff 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 apx-*that would outrank it.sidebar-filter-state.test.ts: unit coverage for the new predicate.vitest runon the sidebar filter suites — 45 passed.tsc --noEmit -p config/tsconfig.tc.web.json+oxlintclean.