Skip to content

feat: improve drag-and-drop usability on mobile devices (closes #1076)#1135

Open
singhanurag0317-bit wants to merge 1 commit into
aryandas2911:mainfrom
singhanurag0317-bit:feat/mobile-dnd-improvements
Open

feat: improve drag-and-drop usability on mobile devices (closes #1076)#1135
singhanurag0317-bit wants to merge 1 commit into
aryandas2911:mainfrom
singhanurag0317-bit:feat/mobile-dnd-improvements

Conversation

@singhanurag0317-bit
Copy link
Copy Markdown

Summary

Resolves #1076

The RoutineBuilder planner's drag-and-drop was built exclusively around PointerSensor, which causes two major issues on touch devices:

  1. Normal page scrolling accidentally activates drags.
  2. Task items and drop zones are too small for reliable thumb targeting.

Changes

frontend/src/pages/RoutineBuilder.jsx

  • Added TouchSensor from @dnd-kit/core with activationConstraint: { 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.
  • Added distance constraint to PointerSensor (distance: 5) to prevent jitter-triggered drags on desktop.
  • Upgraded DragOverlay from a plain white box to a branded teal card with a GripVertical icon, giving users clear visual feedback that a drag is in progress on any device.

frontend/src/components/Routine/TaskLibrary.jsx

  • Added touch-none to DraggableTask so the browser does not intercept touch events for scrolling while a drag is being initiated.
  • Added min-h-[52px] to meet the 48 dp minimum touch-target guideline (Material Design / WCAG 2.5.8).

frontend/src/components/Routine/WeeklyGrid.jsx

  • Increased DroppableCell height to min-h-[3.5rem] on mobile (sm:min-h-[3rem] on desktop) so thumbs can land in the drop zone without pixel-perfect precision.
  • Added touch-none to prevent scroll interference while a dragged item is hovering over a cell.

Verification

npm run build completes successfully (✓ 2227 modules, zero errors).

- 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
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.

Improve drag-and-drop usability on mobile devices

1 participant