From 3d57fc96a3c05f4ebfcd0df39b430c591667c3bc Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Fri, 19 Dec 2025 09:52:02 -0800 Subject: [PATCH] feat: wire up breadcrumb click navigation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Click Room → zooms camera to that room - Click Floor/Building/Facility → returns to isometric overview - Completes Phase 3 hierarchy navigation spec --- frontend/src/pages/Facility3DViewerPage.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/frontend/src/pages/Facility3DViewerPage.tsx b/frontend/src/pages/Facility3DViewerPage.tsx index 4c87abf..e014622 100644 --- a/frontend/src/pages/Facility3DViewerPage.tsx +++ b/frontend/src/pages/Facility3DViewerPage.tsx @@ -164,6 +164,24 @@ export default function Facility3DViewerPage() { setSelectedPlant(null); }; + // Breadcrumb navigation handler + const handleBreadcrumbNavigate = (level: string) => { + if (!floorData || !selectedPlant) return; + + if (level === 'room' && selectedPlant.breadcrumb?.room) { + // Find the room by name and focus on it + const room = floorData.rooms.find(r => r.name === selectedPlant.breadcrumb?.room); + if (room) { + focusRoom(room); + } + } else if (level === 'floor' || level === 'building' || level === 'facility') { + // Return to floor overview + setCameraPreset('ISOMETRIC'); + setFocusTarget(null); + } + // Section/tier clicks stay on current view but could highlight + }; + // Search result selection handler const handleSearchSelect = useCallback((result: any) => { if (!floorData) return; @@ -395,6 +413,7 @@ export default function Facility3DViewerPage() { section: selectedPlant.breadcrumb.section, tier: selectedPlant.tier, }} + onNavigate={handleBreadcrumbNavigate} /> )}