Skip to content

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

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

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

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Addresses #3241

Generated by cmux-loader.

Recorded videos:

  • repro-before: .runner/videos/repro-before.mov (ok)
  • fixed-after: .runner/videos/fixed-after.mov (ok, attempts=4)

Run artifacts: https://github.com/manaflow-ai/cmux-loader/actions/runs/25090436911

Codex final message:

Implemented for #3241 in:

What changed:

  • In the sidebar ScrollView resolver, the resolved NSScrollView is now configured for overflow-aware behavior:
    • scrollerStyle = .overlay
    • autohidesScrollers = true
  • Removed maxHeight: .infinity from SidebarEmptyArea, preventing it from forcing artificial overflow content sizing in the sidebar.

Verification:

  • Built with tag-required reload:
    • ./scripts/reload.sh --tag loader (completed successfully)
  • Captured required GUI recordings:
    • repro-before.mov
    • fixed-after-4.mov
  • Confirmed the fixed-attempt recording was taken after restoring a single-workspace state (workspace 1 of 1) and rerunning the app after edits.

No PR was opened.


Summary by cubic

Fixes the sidebar so the scrollbar only shows when content overflows and hides otherwise. Addresses #3241 with overlay scrollers and removal of artificial overflow.

  • Bug Fixes
    • Configure resolved NSScrollView with scrollerStyle = .overlay and autohidesScrollers = true.
    • Remove maxHeight: .infinity from SidebarEmptyArea to stop forcing overflow.

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

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced sidebar scrollbar behavior with overlay indicators and auto-hiding during idle states
    • Fixed layout constraints in sidebar empty area to prevent excessive expansion

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 4:22am
cmux-staging Building Building Preview, Comment Apr 29, 2026 4:22am

@coderabbitai

coderabbitai Bot commented Apr 29, 2026 •

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e6f3732f-e297-4e77-bf91-61a9083c9f75

📥 Commits

Reviewing files that changed from the base of the PR and between af36cab and e511008.

📒 Files selected for processing (1)
  • Sources/ContentView.swift

📝 Walkthrough

Walkthrough

ContentView.swift updated with sidebar scroll view configuration for overlay indicators and auto-hiding scrollbars before drag auto-scroll attachment; SidebarEmptyArea layout modified to constrain by maximum width instead of infinite height.

Changes

Cohort / File(s) Summary
Sidebar Scroll and Layout Configuration
Sources/ContentView.swift
Sidebar scroll view now uses overlay scroll indicators with auto-hiding behavior prior to drag auto-scroll controller attachment. SidebarEmptyArea layout changed to constrain by maximum width only instead of infinite height expansion, while retaining background, content shape, tap handler, drop handling, and top drop indicator overlay.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 Scrollbars now hide with grace so fine,
Overlay style makes the sidebar shine,
Layout constraints grow wisely bound,
No infinite heights to slow us down,
Hopping through code, improvement's found! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change—fixing the sidebar scrollbar to only appear when content overflows, addressing the core issue in the PR.
Description check ✅ Passed The PR description is comprehensive and covers what changed and why, includes verification steps and video artifacts, but lacks explicit testing checklist items and review bot request formatting.
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-video20

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: 3/8 reviews remaining, refill in 30 minutes and 3 seconds.

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

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

Closing this loader dogfood PR because the repro video is clean but the fixed-after videos still include the macOS FileVault confirmation sheet. I am patching the runner setup suppression again and will rerun from a fresh branch.

@lawrencecchen
lawrencecchen deleted the loader/issue-3241-sidebar-scrollbar-video20 branch April 29, 2026 04:21
@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes the sidebar scrollbar always-visible issue by configuring the resolved NSScrollView with scrollerStyle = .overlay and autohidesScrollers = true, and removes maxHeight: .infinity from SidebarEmptyArea.body.

  • The scrollbar visual fix via scrollerStyle/autohidesScrollers is correct and addresses the reported symptom, but the SidebarEmptyArea change is a no-op: the same maxHeight: .infinity is still applied to that view at its call site (workspaceScrollContent, line 9882), so the artificial height inflation the PR description attributes to it remains in place.

Confidence Score: 3/5

The scrollbar visual fix is correct, but the stated content-sizing fix is a no-op; the artificial height inflation remains.

The primary symptom (scrollbar always visible) is addressed by the overlay/autohide changes. However, the SidebarEmptyArea body change is ineffective because maxHeight: .infinity is still applied at the call site in workspaceScrollContent (line 9882), leaving the underlying content-sizing issue described in the PR unresolved. This is a P1 logic defect on the changed path.

Sources/ContentView.swift — specifically line 9882 where .frame(maxWidth: .infinity, maxHeight: .infinity) is still applied to SidebarEmptyArea.

Important Files Changed

Filename Overview
Sources/ContentView.swift Adds overlay/autohide scrollbar config to the sidebar ScrollView resolver (correct fix), and removes maxHeight: .infinity from SidebarEmptyArea.body — but the same constraint is still applied at the call site (line 9882), making that change a no-op.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[workspaceScrollArea] --> B[ScrollView]
    B --> C[SidebarScrollViewResolver]
    C --> D["scrollerStyle = .overlay\nautohidesScrollers = true\n✅ NEW"]
    C --> E[dragAutoScrollController.attach]
    B --> F[workspaceScrollContent]
    F --> G[VStack]
    G --> H[workspaceRows]
    G --> I["SidebarEmptyArea\n.frame(maxWidth: .infinity, maxHeight: .infinity)\n⚠️ Call-site still has maxHeight: .infinity"]
    I --> J["SidebarEmptyArea.body\n.frame(maxWidth: .infinity)\nchanged in PR — no-op"]
Loading

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

Comment thread Sources/ContentView.swift
Color.clear
.contentShape(Rectangle())
.frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(maxWidth: .infinity)

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.

P1 SidebarEmptyArea change is a no-op — maxHeight: .infinity still applied at call site

Removing maxHeight: .infinity from inside SidebarEmptyArea.body has no effect because the call site in workspaceScrollContent (line 9882) immediately re-applies .frame(maxWidth: .infinity, maxHeight: .infinity) to the same view:

SidebarEmptyArea(...)
    .frame(maxWidth: .infinity, maxHeight: .infinity)  // line 9882 — still present

The outer frame modifier wraps the view, so the SidebarEmptyArea still requests unlimited height inside the ScrollView. If the goal is to remove artificial height inflation that causes unneeded scroll overflow, the maxHeight: .infinity at the call site also needs to be removed. The actual scrollbar visual fix (.overlay + autohidesScrollers) addresses the symptom, but the underlying content sizing issue described in the PR remains.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e511008d83

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/ContentView.swift
Comment on lines 12192 to 12195
Color.clear
.contentShape(Rectangle())
.frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(maxWidth: .infinity)
.onTapGesture(count: 2) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep SidebarEmptyArea hit target expanded vertically

Removing maxHeight: .infinity from SidebarEmptyArea shrinks the view that owns .onTapGesture/.onDrop, so the interactive empty-sidebar region can collapse to minimal height when there are few workspaces. In that state, double-click-to-create-workspace and drop-to-end only work on a thin strip instead of the whole empty area, because the outer frame applied at the call site does not restore this view’s internal hit-test region.

Useful? React with 👍 / 👎.

This branch was successfully deployed

1 active deployment
Preview – cmux — e511008d 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.

1 participant