Skip to content

fix(sidebar): only show the projects scrollbar when the list overflows - #7845

Merged
brennanb2025 merged 1 commit into
stablyai:mainfrom
OrcaWin:explain-windows-caret-icon
Jul 9, 2026
Merged

brennanb2025 merged 1 commit into
stablyai:mainfrom
OrcaWin:explain-windows-caret-icon

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Jul 8, 2026 •

Copy link
Copy Markdown
Collaborator

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: scroll with a reserved scrollbar-gutter: stable, so the scrollbar track is always present even when there's nothing to scroll. Two consequences on Windows:

  • The reserved gutter insets the rows (which live inside the scroll container) but not the fixed header — so the row + is pushed left of the header +.
  • With classic Windows scrollbars, the always-present track also paints the ▲/▼ arrow buttons in that gutter (the "up caret"), even with nothing to scroll.

macOS overlay scrollbars reserve no gutter and draw no buttons, so none of this shows there.

Fix

Switch the projects list to overflow-y: auto and drop the reserved scrollbar-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-auto on the two sidebar scroll containers.
  • main.css: remove scrollbar-gutter: stable from .worktree-sidebar-scrollbar.

Verified (live, in a dev Orca instance on Windows via CDP)

Measured the header + and the hovered row + right-edges:

header + row + delta
Before x=272 x=262 10px
After x=272 x=272 0px
  • Fits: gutter 0 → no scrollbar, no caret, +s flush at the edge (matches macOS).
  • Overflows: scrollbar reappears and scrolls normally; virtual rows still render.

Notes / scope

  • macOS unchanged — it already reserved no gutter (overlay scrollbars), so this is a no-op there.
  • Trade-off: when the list does overflow, the scrollbar consumes width as it appears (content shifts by the scrollbar width) — standard behavior, and the same as macOS conceptually. The previous scrollbar-gutter: stable avoided that shift at the cost of the always-present gutter/arrows.
  • When the list overflows on older Windows/Chromium (classic scrollbars), the ▲/▼ buttons still appear on the real scrollbar. That's the expected "there is a scrollbar" case; happy to also switch the sidebar to a custom (webkit) button-free scrollbar on Windows if you want them gone there too.

@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This change updates the worktree sidebar scrollbar styling in main.css and switches both sidebar scroll containers in WorktreeList.tsx from overflow-y-scroll to overflow-y-auto. The sidebar scrollbar rule no longer reserves the gutter up front or sets non-webkit scrollbar colors, while keeping the right padding and webkit thumb styling.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the fix and verification, but it omits required Screenshots, Testing, AI Review Report, and Security Audit sections. Add the missing template sections: Screenshots, Testing, AI Review Report, and Security Audit, or explicitly mark them not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 UI change: showing the projects scrollbar only when the list overflows.

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.

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.
@OrcaWin
OrcaWin force-pushed the explain-windows-caret-icon branch from b891b77 to aa29488 Compare July 9, 2026 06:19
@OrcaWin OrcaWin changed the title fix(ui): stop Windows native scrollbar caret buttons on custom scrollbars fix(sidebar): only show the projects scrollbar when the list overflows Jul 9, 2026

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

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-color still overrides the ::-webkit-scrollbar* styles here in Chromium. .worktree-sidebar-scrollbar keeps scrollbar-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 value

STYLEGUIDE.md now describes stale behavior for .worktree-sidebar-scrollbar.

docs/STYLEGUIDE.md documents this class as one that "reserves the gutter," but the rule no longer sets scrollbar-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.css
  • src/renderer/src/components/sidebar/WorktreeList.tsx

@brennanb2025
brennanb2025 merged commit 81e4f0f into stablyai:main Jul 9, 2026
1 check passed
Jinwoo-H added a commit that referenced this pull request Jul 9, 2026
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]>
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.

2 participants