Skip to content

fix(web): fix native scrollbar being intercepted by sidebar rail on windows and linux#618

Merged
t3dotgg merged 1 commit intopingdotgg:mainfrom
saishankar404:fix/scrollbar-rail-offcanvas
Mar 9, 2026
Merged

fix(web): fix native scrollbar being intercepted by sidebar rail on windows and linux#618
t3dotgg merged 1 commit intopingdotgg:mainfrom
saishankar404:fix/scrollbar-rail-offcanvas

Conversation

@saishankar404
Copy link
Contributor

@saishankar404 saishankar404 commented Mar 9, 2026

fixes #548

the sidebar rail is a 16px wide invisible button sitting at z-20 along the
edge of the sidebar. when the sidebar is offcanvas and collapsed, that hit
area ends up exactly where the native os scrollbar lives, so clicks and drags
on the scrollbar were toggling the sidebar instead.

one css class added to SidebarRail:
[[data-collapsible=offcanvas][data-state=collapsed]_&]:pointer-events-none

scoped to offcanvas+collapsed only so icon mode (where the rail stays visible
and needs to be clickable to expand) is completely unaffected.

Note

Prevent sidebar rail button from intercepting native scrollbar on Windows and Linux by applying pointer-events-none when SidebarRail is offcanvas and collapsed in sidebar.tsx

Add a state-selective pointer-events-none to the SidebarRail button when data-collapsible=offcanvas and data-state=collapsed in sidebar.tsx; include an inline comment documenting the condition.

📍Where to Start

Start with the SidebarRail component’s button className logic in sidebar.tsx.

Macroscope summarized 5d3d46c.

…apsed

the rail's 16px hit area at z-20 sits right where the native os scrollbar
lives when the sidebar is in offcanvas mode and collapsed. this causes clicks
and drags on the scrollbar to toggle the sidebar instead on windows and linux.

scoping pointer-events-none to [data-collapsible=offcanvas][data-state=collapsed]
fixes the interception without affecting icon mode where the rail needs to stay
clickable.
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 1dabbaa3-66b4-4e88-b1dd-8ca02374fd95

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@github-actions github-actions bot added the vouch:unvouched PR author is not yet trusted in the VOUCHED list. label Mar 9, 2026
@CodeZeno
Copy link

CodeZeno commented Mar 9, 2026

Tested this on Windows against the v0.0.8 desktop app behavior and this fix resolves the issue for me.

Before this change, trying to drag the chat history scrollbar could hit the collapsed sidebar rail instead and open/toggle the sidebar. With this branch applied, the scrollbar is draggable normally again.

I can confirm the Windows fix. I have not tested Linux.

@t3dotgg t3dotgg merged commit 4b6a0c4 into pingdotgg:main Mar 9, 2026
7 checks passed
raphaelluethy pushed a commit to raphaelluethy/t3code that referenced this pull request Mar 9, 2026
…indows and linux (pingdotgg#618)

the rail's 16px hit area at z-20 sits right where the native os scrollbar
lives when the sidebar is in offcanvas mode and collapsed. this causes clicks
and drags on the scrollbar to toggle the sidebar instead on windows and linux.

scoping pointer-events-none to [data-collapsible=offcanvas][data-state=collapsed]
fixes the interception without affecting icon mode where the rail needs to stay
clickable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrollbar doesn't work on Windows

3 participants