Skip to content

Commit d53e54f

Browse files
rafavallsclaude
andcommitted
fix(ui): use viewport width for lg breakpoint in dashboard row height calculation
The column-count check was using container width, but lg:grid-cols-5 uses viewport width. Switch to window.innerWidth to stay in sync with the Tailwind breakpoint, and add a window resize listener so row height recalculates when the viewport crosses the 1024px threshold. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent 855e9ec commit d53e54f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/mesh/src/web/components/monitoring/dashboard-view.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,18 @@ function DashboardViewContent({
456456
if (!el) return;
457457
const update = () => {
458458
const gap = 16; // gap-4
459-
const cols = el.clientWidth >= 1024 ? 5 : 2;
459+
const cols = window.innerWidth >= 1024 ? 5 : 2;
460460
const colW = (el.clientWidth - gap * (cols - 1)) / cols;
461461
el.style.gridAutoRows = `${colW}px`;
462462
};
463463
update();
464464
const observer = new ResizeObserver(update);
465465
observer.observe(el);
466+
window.addEventListener("resize", update);
467+
return () => {
468+
observer.disconnect();
469+
window.removeEventListener("resize", update);
470+
};
466471
}}
467472
>
468473
{dashboard.widgets.map((widget) => {

0 commit comments

Comments
 (0)