From c05d27c11548afb25984df3e585d1ca6fa3b92a3 Mon Sep 17 00:00:00 2001 From: owain Date: Thu, 11 Jun 2026 23:36:29 +0100 Subject: [PATCH] Dashboard grid: 1-col min width for stats, vertical compaction for make-room dragging - Stat widgets can now be resized down to a single column (minW 1) - Switch to vertical compaction so dragging a widget pushes others down to reveal the drop spot, then settles (fixes both the no-move and fly-off behaviours) Co-Authored-By: Claude Opus 4.8 --- frontend/src/pages/DashboardPage.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/DashboardPage.jsx b/frontend/src/pages/DashboardPage.jsx index 3347d77..451c52c 100644 --- a/frontend/src/pages/DashboardPage.jsx +++ b/frontend/src/pages/DashboardPage.jsx @@ -45,7 +45,7 @@ const STAT_DEFS = { // Full widget registry: size defaults + palette label. Stats inherit from STAT_DEFS. const WIDGETS = { - ...Object.fromEntries(Object.entries(STAT_DEFS).map(([id, d]) => [id, { label: d.label, w: 2, h: 1, minW: 2, minH: 1 }])), + ...Object.fromEntries(Object.entries(STAT_DEFS).map(([id, d]) => [id, { label: d.label, w: 2, h: 1, minW: 1, minH: 1 }])), weekly: { label: 'Weekly distance', w: 6, h: 3, minW: 4, minH: 2 }, bodyBattery: { label: 'Body Battery', w: 4, h: 3, minW: 3, minH: 2 }, vo2maxTrend: { label: 'VO₂ max trend', w: 3, h: 3, minW: 2, minH: 2 }, @@ -629,8 +629,7 @@ export default function DashboardPage() { isDraggable={editMode} isResizable={editMode} onLayoutChange={handleLayoutChange} - compactType={null} - preventCollision + compactType="vertical" draggableCancel=".widget-delete" > {layout.filter(l => WIDGETS[l.i]).map(l => (