feat: wire up breadcrumb click navigation
Some checks are pending
Deploy to Production / deploy (push) Waiting to run
Test / backend-test (push) Waiting to run
Test / frontend-test (push) Waiting to run

- Click Room → zooms camera to that room
- Click Floor/Building/Facility → returns to isometric overview
- Completes Phase 3 hierarchy navigation spec
This commit is contained in:
fullsizemalt 2025-12-19 09:52:02 -08:00
parent 940c1d9b79
commit 3d57fc96a3

View file

@ -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}
/>
</div>
)}