Repository navigation
fix(sidebar): only show the projects scrollbar when the list overflows - #7845
Conversation
📝 WalkthroughWalkthroughThis change updates the worktree sidebar scrollbar styling in 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
The projects list used overflow-y:scroll with a reserved scrollbar-gutter, so the scrollbar track was always present even with nothing to scroll. On Windows (classic scrollbars) that painted the up/down arrow buttons and, because the reserved gutter insets the rows but not the fixed header, pushed the hovered project-row controls ~10px left of the header's + button. macOS overlay scrollbars reserve no gutter, so it looked fine there. Switch the list to overflow-y:auto and drop the reserved gutter: when the list fits there is no scrollbar, no arrow buttons, and the row controls stay flush with the header controls (matching macOS); the scrollbar returns only while actually scrolling.
b891b77 to
aa29488
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/renderer/src/assets/main.css (1)
476-499: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
scrollbar-colorstill overrides the::-webkit-scrollbar*styles here in Chromium..worktree-sidebar-scrollbarkeepsscrollbar-color: transparent transparent;and also sets a hover value, so the WebKit thumb rules can still be ignored and the Windows scrollbar-button regression can reappear. Drop the standard property from this class and keep the hover styling in the WebKit pseudo-element rules only.
🧹 Nitpick comments (1)
src/renderer/src/assets/main.css (1)
476-483: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueSTYLEGUIDE.md now describes stale behavior for
.worktree-sidebar-scrollbar.
docs/STYLEGUIDE.mddocuments this class as one that "reserves the gutter," but the rule no longer setsscrollbar-gutter: stable. Worth updating the doc alongside this change so the documented contract stays accurate.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bb8b5070-bbc2-43b0-91c0-8112f9840bff
📥 Commits
Reviewing files that changed from the base of the PR and between b891b77fc2450bdb222a79f7fc4d3cf57ef8ff4c and aa29488.
📒 Files selected for processing (2)
src/renderer/src/assets/main.csssrc/renderer/src/components/sidebar/WorktreeList.tsx
Clean auto-merge, no conflicts. Brought in from main: - feat(codex): write in-Codex setting changes back to ~/.codex config (#7960) — codex-config-mirror.ts, config-settings-promotion.ts - Separate pane identity from liveness in the tab-agent resolver, fixes OMP tab flicker (#7860) — pane-agent-owner.ts, use-tab-agent.ts - fix(sidebar): only show projects scrollbar when the list overflows (#7845) Perf-branch structure preserved (clean auto-merge; pty-connection.ts auto-merged without conflict). Gates: typecheck 0 errors; lint 0 errors; ipc/pty + daemon + codex + terminal-pane + lib + runtime + shared + pane-manager suites all pass (9015 + 2120 tests, 0 failed). Co-authored-by: Orca <[email protected]>
Problem
In the Projects sidebar on Windows, hovering a project row reveals its controls (
⌄ … +), but the row's+sits ~10px left of the Projects header's+— they're not flush. macOS lines them up fine.Root cause: the list uses
overflow-y: scrollwith a reservedscrollbar-gutter: stable, so the scrollbar track is always present even when there's nothing to scroll. Two consequences on Windows:+is pushed left of the header+.macOS overlay scrollbars reserve no gutter and draw no buttons, so none of this shows there.
Fix
Switch the projects list to
overflow-y: autoand drop the reservedscrollbar-gutter. When the list fits, there's no scrollbar, no gutter, and no arrow buttons — the row controls stay flush with the header controls, matching macOS. The scrollbar returns only while the list actually overflows.WorktreeList.tsx:overflow-y-scroll→overflow-y-autoon the two sidebar scroll containers.main.css: removescrollbar-gutter: stablefrom.worktree-sidebar-scrollbar.Verified (live, in a dev Orca instance on Windows via CDP)
Measured the header
+and the hovered row+right-edges:+++s flush at the edge (matches macOS).Notes / scope
scrollbar-gutter: stableavoided that shift at the cost of the always-present gutter/arrows.