feat: improve drag-and-drop usability on mobile devices (closes #1076)#1135
Open
singhanurag0317-bit wants to merge 1 commit into
Open
feat: improve drag-and-drop usability on mobile devices (closes #1076)#1135singhanurag0317-bit wants to merge 1 commit into
singhanurag0317-bit wants to merge 1 commit into
Conversation
- Add TouchSensor with 250ms hold-delay + 8px tolerance so normal page scroll no longer accidentally starts a drag on touch screens - Add 5px distance activation constraint to PointerSensor to prevent jitter on desktop - Upgrade DragOverlay to a teal branded card with GripVertical icon for clear visual feedback during drag on all devices - Add touch-none + min-h-[52px] to DraggableTask items for reliable 48dp touch targets in the Task Library sidebar - Increase DroppableCell height to min-h-[3.5rem] on mobile (sm:3rem) and add touch-none to prevent scroll interference during drop hover Closes aryandas2911#1076
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #1076
The
RoutineBuilderplanner's drag-and-drop was built exclusively aroundPointerSensor, which causes two major issues on touch devices:Changes
frontend/src/pages/RoutineBuilder.jsxTouchSensorfrom@dnd-kit/corewithactivationConstraint: { delay: 250, tolerance: 8 }.The 250 ms hold-delay means a quick swipe-to-scroll is never mistaken for a drag. The 8 px tolerance allows slight finger movement without cancelling the gesture.
PointerSensor(distance: 5) to prevent jitter-triggered drags on desktop.DragOverlayfrom a plain white box to a branded teal card with aGripVerticalicon, giving users clear visual feedback that a drag is in progress on any device.frontend/src/components/Routine/TaskLibrary.jsxtouch-nonetoDraggableTaskso the browser does not intercept touch events for scrolling while a drag is being initiated.min-h-[52px]to meet the 48 dp minimum touch-target guideline (Material Design / WCAG 2.5.8).frontend/src/components/Routine/WeeklyGrid.jsxDroppableCellheight tomin-h-[3.5rem]on mobile (sm:min-h-[3rem]on desktop) so thumbs can land in the drop zone without pixel-perfect precision.touch-noneto prevent scroll interference while a dragged item is hovering over a cell.Verification
npm run buildcompletes successfully (✓ 2227 modules, zero errors).