Skip to content

fix: make folding sidebar touch interactions reliable - #4423

Open
mvanhorn wants to merge 1 commit into
bitfocus:mainfrom
mvanhorn:fix/4361-touch-sidebar-folding
Open

fix: make folding sidebar touch interactions reliable#4423
mvanhorn wants to merge 1 commit into
bitfocus:mainfrom
mvanhorn:fix/4361-touch-sidebar-folding

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Aug 20, 2026

Copy link
Copy Markdown

In desktop folding mode, choosing a sidebar navigation item is meant to return the dynamic sidebar to its narrow state. SidebarRoot currently recognizes selections through a native mouseup listener, so touch input depends on browser-generated compatibility mouse events and behaves inconsistently in Firefox on Windows. The reporter has observed the sidebar remaining expanded, briefly expanding and collapsing, or staying collapsed after otherwise equivalent touches.

In desktop folding mode, completing a primary touch pointer interaction on a navigation link applies the deferred temporary narrow state and leaves route selection behavior intact.

Summary by CodeRabbit

Update SidebarRoot to handle completed primary pointer interactions directly so mouse, touch, and pen navigation share one fold-after-selection path without relying on synthetic mouse events. Preserve the existing exclusions for secondary-button context menus, group toggles, footer controls, blank areas, and mobile-mode dismissal, including the deferred state update that avoids racing route navigation. Account for non-hover touch pointers re-entering a temporarily narrowed folding sidebar so the explicit narrow state does not prevent a subsequent touch from expanding and selecting another item.

Closes #4361

Summary by CodeRabbit

  • Bug Fixes

    • Improved sidebar interactions across touch, mouse, and pen input.
    • Mobile sidebar dismissal and narrowed-sidebar folding now respond more reliably.
    • Touch interaction temporarily expands a narrowed sidebar before navigation.
    • Secondary clicks and non-navigation controls no longer trigger unintended sidebar changes.
  • Tests

    • Added comprehensive coverage for sidebar navigation, folding, touch expansion, and mobile behavior.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d945cfa2-5f52-44ae-86ec-5833a292d987

📥 Commits

Reviewing files that changed from the base of the PR and between 5cdbfeb and d92abda.

📒 Files selected for processing (2)
  • webui/src/Layout/Sidebar.tsx
  • webui/src/Layout/__tests__/Sidebar.test.tsx

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Sidebar pointer interactions

Layer / File(s) Summary
Pointer event handling
webui/src/Layout/Sidebar.tsx
Sidebar folding, temporary expansion, mobile dismissal, listener registration, and pointer-entry handling now use pointer events.
Interaction behavior validation
webui/src/Layout/__tests__/Sidebar.test.tsx
Tests cover touch, mouse, and pen input, deferred folding, ignored targets, navigation, temporary expansion, and mobile dismissal.

Poem

Pointers tap and pointers glide,
The sidebar folds with care.
Touch expands its narrow side,
Then settles smoothly there.
Mouse and pen join the play,
While routes stay on their way.

Merge Risk: ⚪ Minimal · up to d92ab

This localized sidebar interaction change is merge-ready after normal checks and review; no actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: reliable folding behavior for touch interactions in the sidebar.
Linked Issues check ✅ Passed The changes address issue #4361 by folding the dynamic sidebar after touch navigation while preserving required exclusions and route selection.
Out of Scope Changes check ✅ Passed The implementation and related interaction tests remain within the linked issue scope.

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.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

[BUG] Sidebar not touch friendly

2 participants