fix(desktop): keep resizable sidebar rail off adjacent scrollbars#2019
fix(desktop): keep resizable sidebar rail off adjacent scrollbars#2019xipeng-jin wants to merge 1 commit intopingdotgg:mainfrom
Conversation
- Description: The right resizable sidebar rail was overlapping the main chat pane’s native scrollbar, so hovering the scrollbar showed the resize cursor and dragging resized the sidebar instead of scrolling. The new selector set only handled expanded and offcanvas-collapsed states, which also left `collapsible="icon"` collapsed sidebars without explicit rail positioning. - What changed: This change moves the rail fully inside the sidebar edge for expanded left/right sidebars, keeps offcanvas-collapsed rails non-interactive, and adds explicit collapsed-icon positioning for both the rail and its divider. The fix lives in the shared sidebar component so all current and future right-side panels get the correct behavior without route-specific hacks.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
ApprovabilityVerdict: Approved This is a CSS-only positioning fix that keeps the sidebar rail from overlapping adjacent scrollbars. The production code change is minimal (reorganizing CSS positioning classes), with comprehensive browser and unit tests added. No runtime behavior or logic changes. You can customize Macroscope's approvability policy. Learn more. |
Description: The right resizable sidebar rail was overlapping the main chat pane’s native scrollbar, so hovering the scrollbar showed the resize cursor and dragging resized the sidebar instead of scrolling. The previous selector set also did not explicitly position rails for
collapsible="icon"collapsed sidebars.What changed: This updates the shared sidebar rail selectors so expanded left/right sidebars keep the rail fully inside the sidebar edge, offcanvas-collapsed rails stay non-interactive, and collapsed-icon sidebars get explicit rail and divider positioning. It also adds regression coverage for rail placement and resizing behavior so current and future side panels inherit the fix without route-specific workarounds.
What Changed
Moved
SidebarRailpositioning into explicit selector sets in the shared sidebar component so the expanded rail sits inside the sidebar boundary instead of overlapping the adjacent pane. Added explicit collapsed-icon positioning for both left and right sidebars, while keeping offcanvas-collapsed rails non-interactive.Added regression tests for:
sidebar.test.tsxWhy
When the right diff sidebar was open, the resize rail extended over the main chat pane’s native scrollbar. That made the scrollbar effectively unclickable because pointer hover and drag were captured by the rail instead.
Fixing this in the shared sidebar component is the right scope because the problem is structural, not specific to the diff panel. Any future right-side panel using the same sidebar rail would otherwise inherit the same bug.
UI Changes
Before:
After:
Screenshots/video to attach:
t3code-fix-side-scrollbar.before.mp4
t3code-fix-side-scrollbar.after.mp4
Checklist
Note
Medium Risk
Changes shared
SidebarRailpositioning/interaction CSS, which can affect resize/toggle hit targets across all desktop sidebars. Adds coverage, but regressions could impact basic navigation/resizing UX.Overview
Fixes desktop resizable sidebar rails so the expanded rail sits fully inside the sidebar edge (left and right) instead of overlapping the adjacent pane’s scrollbar hit area.
Refactors
SidebarRailclass logic into shared selector constants, adds explicit positioning forcollapsible="icon"collapsed sidebars, and keepsoffcanvas-collapsed rails non-interactive.Adds regression tests: static markup assertions for the new rail selectors and a new Vitest browser test that hit-tests the main pane edge and verifies resizing still works from inside the sidebar boundary.
Reviewed by Cursor Bugbot for commit 8deb692. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
SidebarRailpositioning to avoid overlapping adjacent scrollbar hit targetsSidebarRailto sit fully inside the sidebar edge (left-0/right-0) instead of straddling the boundary, preventing it from intercepting clicks on adjacent scrollbars.-left-2/-right-2) and set topointer-events-noneso they don't intercept any interaction.Macroscope summarized 8deb692.