feat: add mobile swipe gestures for sidebar navigation#1679
feat: add mobile swipe gestures for sidebar navigation#167942tg wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
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 |
e28e042 to
ba9aa5c
Compare
ApprovabilityVerdict: Needs human review This PR introduces a new mobile feature: swipe gestures to open/close the sidebar. While the implementation is well-structured with separated logic and unit tests, it adds new user-facing touch interaction behavior that warrants human review before merging. You can customize Macroscope's approvability policy. Learn more. |
ba9aa5c to
a865914
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| return "pulling"; | ||
| } | ||
| return "idle"; | ||
| } |
There was a problem hiding this comment.
Pull gesture exports unused in production code
Low Severity
resolvePullGestureState, PULL_THRESHOLD, and PullGestureState are exported but never imported by any production code — only the test file references them. The PullToReveal component mentioned in the PR description does not exist in the codebase, making this dead code that adds maintenance surface with no consumers.
- Add sidebar.swipe.logic.ts with pure state machine for horizontal swipe and vertical pull-down gesture detection - Wrap mobile sidebar sheet with SwipeToDismiss for drag-to-close - Detect edge swipes in SidebarInset to open sidebar - Add PullToReveal component for pull-down gesture feedback - Auto-close mobile sidebar on thread selection - 17 new tests for gesture logic
a865914 to
96e1915
Compare


Summary
sidebar.swipe.logic.ts) with full test coverageTest plan
bun run testto verify swipe logic unit tests passNote
Medium Risk
Adds new touch gesture handling that changes mobile navigation and sheet interaction; risk is mainly UX regressions (scroll vs swipe conflicts, unexpected auto-close) rather than data/security impact.
Overview
Adds mobile touch gestures for the sidebar: swipe-from-left-edge on
SidebarInsetopens the mobile sidebar with a live edge "peek" indicator, and swiping the open mobile sheet dismisses it via a newSwipeToDismisswrapper.Introduces a new pure gesture state module (
sidebar.swipe.logic.ts) with configurable thresholds and scroll-cancellation rules, plus a dedicated Vitest suite to lock behavior. Also updatesSidebar.tsxto auto-close the mobile sidebar when navigating to a thread (click or programmatic navigation).Written by Cursor Bugbot for commit 96e1915. This will update automatically on new commits. Configure here.
Note
Add mobile swipe gestures to open and dismiss the sidebar
SwipeToDismisscomponent insidebar.tsxthat wraps mobile sidebar sheet content; swiping horizontally pastSWIPE_THRESHOLDin the closing direction triggerssetOpenMobile(false).SidebarInset: touches starting within 80px of the left edge can open the sidebar, with a visual edge peek indicator that grows as the user drags.resolveSwipeGestureStateandresolvePullGestureStatewith threshold-based lock-in and vertical-scroll cancellation logic, covered by a dedicated test suite.Sidebar.tsx.Macroscope summarized 96e1915.