mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The dashboard layout section already let users reorder widgets via ↑/↓ arrow buttons; the v1.4.43 QoL audit (M1) flagged that modern parity with Apple Health and Withings web expects drag-to-reorder as the mouse/touch surface. Adds a GripVertical drag handle on each row wired to @dnd-kit/sortable. The keyboard fallback stays — arrow buttons are unchanged and the new handle is also keyboard-operable via dnd-kit's KeyboardSensor (Tab + Space + arrows). Both surfaces persist through the same draft → PUT path the arrow buttons already used, so save / cancel / reset semantics carry over without changes. Pure reorder logic is extracted into a shared `reorderWidgets` helper so the mutation payload contract is pinned by unit tests without spinning up a DndContext. Bundle delta: ~29 KB gzipped (core 22 + sortable 5 + utilities 2), well within the 50 KB budget called out in the audit. All six locales gain `dragHandle` (button label) and `dragHandleHint` (shared `aria-describedby` paragraph) keys.