From 84f3b1646176222df82781c7a198057ecae7a051 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Mar 2026 10:15:52 +0000 Subject: [PATCH] Fix DraggableGridLayout initial height collapse due to nullish coalescing bug availableWidth starts at 0 (not null/undefined) before ResizeObserver fires. The ?? operator passes 0 through instead of falling back to window.innerWidth, making cellHeight negative and causing react-grid-layout to render a ~10px container. The overflow-x-hidden div then becomes an implicit scroll container, producing the 'cards squeezed in a small rectangle' symptom. Changing ?? to || makes 0 trigger the window.innerWidth fallback, giving a reasonable initial rowHeight until the real container width is measured. https://claude.ai/code/session_01H1sqbcFmtwwsdNTJcJHJWd --- web/src/views/live/DraggableGridLayout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/views/live/DraggableGridLayout.tsx b/web/src/views/live/DraggableGridLayout.tsx index a37a606f0..cfa3ff918 100644 --- a/web/src/views/live/DraggableGridLayout.tsx +++ b/web/src/views/live/DraggableGridLayout.tsx @@ -359,7 +359,7 @@ export default function DraggableGridLayout({ // subtract container margin, 1 camera takes up at least 4 rows // account for additional margin on bottom of each row return ( - ((availableWidth ?? window.innerWidth) - 2 * marginValue) / + ((availableWidth || window.innerWidth) - 2 * marginValue) / 12 / aspectRatio - marginValue + @@ -712,7 +712,7 @@ export default function DraggableGridLayout({ />