Repository navigation
[drawer] Restore SwipeArea component - #4102
Conversation
atomiks
commented
Feb 16, 2026
- I have followed (at least) the PR section of the contributing guide.
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Automatic reviews are disabled for this repository. |
|
Sometimes it's impossible to close the drawer by clicking on the backdrop: Screen.Recording.2026-02-16.at.14.33.03.movI'm also still experiencing the original issue where the drawer opens halfway when dragged quickly (both with mouse and touchpad). In these cases it's also impossible to close it by clicking outside. Screen.Recording.2026-02-16.at.14.35.19.mov |
|
Claude Code mostly complained about tests: Issues Found in Tests
The test renders <Drawer.Root><Drawer.SwipeArea /></Drawer.Root> with no Portal/Popup/Viewport. After swipe-opening, it clicks document.body and expects the drawer to close via outside-press dismissal. This works because floating-ui's useDismiss considers any click as "outside" when there's no popup element (the popup ref is null). In a real app, you'd always render a Popup when the drawer is open. The test is A more robust test would render the full drawer structure (Portal > Viewport > Popup) and click outside the popup, verifying the drawer closes after the deferred re-enable.
All tests use pointerType: 'mouse'. The component has distinct code paths for touch vs non-touch input (DrawerSwipeArea.tsx:402-429):
The touch path is entirely untested.
The component maps swiping state to data-swiping (line 43-44), but no test verifies this attribute appears during an active swipe gesture.
In "uses a size-based swipe threshold by default", the waitBeforeRelease callback uses a hardcoded wait(120) to ensure the popup has mounted and laid out. While this is Chromium-only (skipping JSDOM), the fixed |
4675ed3 to
fef7b91
Compare
Codex ReviewOverviewThis patch restores Findings (None)No blocking issues found in this patch. Confidence: 5/5High confidence from a full-branch diff review and targeted reruns on the rebased branch, including the touch path, the size-threshold path, and the controlled swipe-dismiss cleanup path. Notes
|
fa28add to
6ea5cec
Compare
6ea5cec to
933677f
Compare