Skip to content

sidebar scrollbar always visible — should only appear when content overflows - #3248

Closed
lawrencecchen wants to merge 1 commit into
mainfrom
loader/issue-3241-sidebar-scrollbar
Closed

lawrencecchen wants to merge 1 commit into
mainfrom
loader/issue-3241-sidebar-scrollbar

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #3241

Generated by cmux-loader.

Codex final message:

Implemented a narrow fix for the sidebar scrollbar behavior.

What I changed

Change is in workspaceScrollArea’s SidebarScrollViewResolver callback:

  • set scrollView.autohidesScrollers = true
  • set scrollView.scrollerStyle = .overlay

This makes the sidebar scrollbar follow overflow/interaction behavior instead of reserving a permanent track.

Verification performed

  • Attempted build command:
    • ./scripts/reload.sh --tag loader
  • Attempted with skip flag:
    • CMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag loader
  • Both failed immediately with:
    • Error: zig is not installed. Install via: brew install zig

Result: I could not build a tagged app in this runner, so I could not run computer-use or capture before/after videos here.

Environment/build constraints

  • Working directory is writable for source edits, but .git is not writable in this session:
    • git commit failed with Unable to create .../.git/index.lock
    • touch .git/... also fails with Operation not permitted

Recorded videos

  • repro-before: not recorded
  • fixed-after: not recorded

PR

  • Not opened yet (no commit could be created in this session due read-only .git).

If you want, I can finish this by creating the commit/PR locally once run in an environment with zig installed and writable .git, then I can also capture and include both required videos.


Summary by cubic

Fixes #3241 by making the sidebar scrollbar appear only when content overflows or during interaction, instead of always being visible. Sets scrollView.autohidesScrollers = true and scrollView.scrollerStyle = .overlay in the sidebar scroll resolver to remove the permanent track.

Written for commit 11a95bb. Summary will update on new commits. Review in cubic

Generated by cmux-loader.
@vercel

vercel Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Apr 29, 2026 0:17am
cmux-staging Building Building Preview, Comment Apr 29, 2026 0:17am

@coderabbitai

coderabbitai Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The sidebar workspace list's NSScrollView is configured during SidebarScrollViewResolver attachment to display overlay scroll indicators that auto-hide, improving the UI appearance while maintaining existing drag autoscroll functionality.

Changes

Cohort / File(s) Summary
Sidebar Scroll View Configuration
Sources/ContentView.swift
Configure NSScrollView to use overlay auto-hiding scroll indicators during SidebarScrollViewResolver attachment, alongside existing drag autoscroll controller setup.

Possibly related PRs

Poem

🐰 A scroll so smooth, a sight so fine,
Overlay bars that gently align,
Auto-hide whispers as we slide,
The workspace hops with perfect pride! ✨

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks required sections including testing evidence, demo video, and PR review trigger. While it explains the technical change and acknowledges missing videos, it does not meet the template requirements. Add a demo video or screenshot showing the fix, include the Review Trigger code block, and complete the checklist with explicit testing confirmation or explanation of why tests were not performed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating the sidebar scrollbar to use overlay style that auto-hides instead of always being visible.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch loader/issue-3241-sidebar-scrollbar

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
Review rate limit: 0/8 reviews remaining, refill in 56 minutes and 44 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the sidebar scrollbar always reserving visible track space by setting autohidesScrollers = true and scrollerStyle = .overlay on the underlying NSScrollView via the existing SidebarScrollViewResolver callback. The nil-guard (if let scrollView) is correctly applied and the change is minimal and well-scoped.

Confidence Score: 4/5

Safe to merge; only one P2 style concern about overriding the system scroll bar preference.

The change is a small, targeted AppKit property assignment with no logic errors. The only concern is a P2: forcing .overlay style may not respect the macOS "Always show scroll bars" accessibility setting. No P0 or P1 issues found.

Sources/ContentView.swift — specifically the scrollerStyle line if system preference compatibility matters.

Important Files Changed

Filename Overview
Sources/ContentView.swift Adds autohidesScrollers and overlay scrollerStyle to the sidebar scroll view; logic is sound but unconditionally forcing .overlay may conflict with the system "Always show scroll bars" accessibility preference.

Sequence Diagram

sequenceDiagram
    participant SwiftUI as SwiftUI (ScrollView)
    participant Resolver as SidebarScrollViewResolverView
    participant NSScrollView as NSScrollView (AppKit)

    SwiftUI->>Resolver: viewDidMoveToWindow / viewDidMoveToSuperview
    Resolver->>Resolver: resolveScrollView() (async)
    Resolver->>NSScrollView: enclosingScrollView (lookup)
    NSScrollView-->>Resolver: NSScrollView? instance
    Resolver->>SwiftUI: onResolve(scrollView)
    Note over SwiftUI,NSScrollView: dragAutoScrollController.attach(scrollView)
    Note over NSScrollView: scrollView.autohidesScrollers = true (NEW)
    Note over NSScrollView: scrollView.scrollerStyle = .overlay (NEW)
Loading

Reviews (1): Last reviewed commit: "Address https://github.com/manaflow-ai/c..." | Re-trigger Greptile

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Closing this first dogfood attempt because the loader runner was missing Zig, so it could not reload cmux or record the required before/after videos. Rerunning from a fresh branch with https://github.com/manaflow-ai/cmux-loader/pull/2.

@lawrencecchen
lawrencecchen deleted the loader/issue-3241-sidebar-scrollbar branch April 29, 2026 00:10
Comment thread Sources/ContentView.swift
dragAutoScrollController.attach(scrollView: scrollView)
if let scrollView {
scrollView.autohidesScrollers = true
scrollView.scrollerStyle = .overlay

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.

P2 scrollerStyle overrides system "Always show scroll bars" preference

Setting scrollerStyle = .overlay unconditionally will override the user's macOS System Preferences setting (System Settings → Appearance → Show scroll bars → Always). NSScrollView normally observes NSScrollerStyleDidChangeNotification and resets its scrollerStyle to match the system pref, but an explicit programmatic assignment wins until the next system-preference change — at which point AppKit will override the custom value since the view never registers to re-apply it.

For users who have "Always" selected (common accessibility need), the sidebar scrollbar will appear as a thin overlay rather than a permanently-visible track. Consider guarding the scrollerStyle assignment behind a check, or omitting it entirely: autohidesScrollers = true alone already removes the always-visible track when the system preference is not "Always".

This branch was successfully deployed

1 active deployment
Preview – cmux — 11a95bb9 Deployed Apr 29, 2026 by vercel[bot]
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.

sidebar scrollbar always visible — should only appear when content overflows

1 participant