feat(GRO-2159): drag-to-reorder + re-optimize on route planner #63
Reference in New Issue
Block a user
Delete Branch "feat/GRO-2159-route-drag-reorder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
GRO-2159 — Route Optimization: Drag-to-Reorder + Optimize UX
Adds drag-and-drop reorder and a re-optimize trigger to the
/admin/routesplanner page (built in GRO-2158).Changes
@dnd-kit/core,@dnd-kit/sortable,@dnd-kit/utilitiesPointerSensor(desktop),TouchSensor(press-and-hold, mobile groomers),KeyboardSensor(a11y) — touch/mobile drag support required by the specPATCH /api/routes/:routeId/reorderwith{ stopOrder: [routeStopId…] }(full first-to-last order, exact permutation the API requires)POST /api/routes/optimizeUAT Playbook
Updated
UAT_PLAYBOOK.md§5.29 — Route Planner: Drag-to-Reorder & Re-optimize (GRO-2159) (7 new test cases: handle present, reorder persists, optimistic rollback, conflict re-eval, re-optimize button, touch drag, groomer own-route).Verification
pnpm typecheck✅pnpm lint✅ (only pre-existing warnings, none in changed files)pnpm test✅ 179 passedpnpm build✅Closes GRO-2159.
Add @dnd-kit drag-and-drop reorder to the /admin/routes stop list. - Install @dnd-kit/core, @dnd-kit/sortable, @dnd-kit/utilities - Sortable stop cards with a grab handle; pointer + touch (press-and-hold) + keyboard sensors so mobile groomers and a11y users can reorder - On drop, PATCH /api/routes/:routeId/reorder { stopOrder } (full order) - Optimistic UI update with rollback + error message on failure - Server recomputes legs/buffers/conflicts; response adopted authoritatively - Tight-schedule conflict warnings retained (server-flagged, gap < travel+buffer) - "Re-optimize" hint+button after a manual reorder (re-runs POST /optimize) - Tests: drag handles, conflict flag, no pre-reorder hint, reorder mock - Updated UAT_PLAYBOOK.md §5.29 — drag-to-reorder & re-optimize cases Co-Authored-By: Paperclip <noreply@paperclip.ing>