From 0d82bb0db44e31e09ac8d4c315769419960ea22d Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Sat, 27 Dec 2025 20:58:35 -0800 Subject: [PATCH] fix: Add row/col/tier to mock 3D data so Racks actually render --- .../components/facility3d/Room3DViewer.tsx | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/facility3d/Room3DViewer.tsx b/frontend/src/components/facility3d/Room3DViewer.tsx index e12dc59..a044320 100644 --- a/frontend/src/components/facility3d/Room3DViewer.tsx +++ b/frontend/src/components/facility3d/Room3DViewer.tsx @@ -41,11 +41,21 @@ export function Room3DViewer({ room, visMode = 'STANDARD', onPlantClick }: Room3 posY: 10, // Centered Y roughly width: 4, height: 20, - positions: Array.from({ length: 16 }).map((__, p) => ({ - id: `p-${i}-${p}`, - name: `P${p + 1}`, - valid: true - })) + positions: Array.from({ length: 16 }).map((__, p) => { + const tier = Math.floor(p / 4); + const remainder = p % 4; + const row = Math.floor(remainder / 2); + const column = remainder % 2; + return { + id: `p-${i}-${p}`, + name: `P${p + 1}`, + valid: true, + tier, + row, + column, + sectionId: `mock-rack-${i}` // Adding sectionId for completeness if needed + }; + }) })); return {