feat: wire up breadcrumb click navigation
- 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:
parent
940c1d9b79
commit
3d57fc96a3
1 changed files with 19 additions and 0 deletions
|
|
@ -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>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue