From 5f6599741259f90fca0a02013d0c05221f77f5a2 Mon Sep 17 00:00:00 2001 From: fullsizemalt <106900403+fullsizemalt@users.noreply.github.com> Date: Fri, 19 Dec 2025 10:04:56 -0800 Subject: [PATCH] fix: include breadcrumb data when selecting plants via search - Add sectionCode to PlantSearch SearchResult - handleSearchSelect now passes room/section to selectedPlant.breadcrumb - This makes breadcrumb visible in plant info panel --- frontend/src/components/facility3d/PlantSearch.tsx | 2 ++ frontend/src/pages/Facility3DViewerPage.tsx | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/facility3d/PlantSearch.tsx b/frontend/src/components/facility3d/PlantSearch.tsx index 8d8f54a..b90df0b 100644 --- a/frontend/src/components/facility3d/PlantSearch.tsx +++ b/frontend/src/components/facility3d/PlantSearch.tsx @@ -8,6 +8,7 @@ interface SearchResult { label: string; sublabel: string; roomName: string; + sectionCode: string; position: { roomX: number; roomY: number; @@ -51,6 +52,7 @@ export function PlantSearch({ floorData, onSelectResult, onHighlightResults }: P label: pos.plant.tagNumber, sublabel: `${pos.plant.strain || 'Unknown'} • ${pos.plant.stage || 'N/A'}`, roomName: room.name, + sectionCode: section.code || section.name, position: { roomX: room.posX, roomY: room.posY, diff --git a/frontend/src/pages/Facility3DViewerPage.tsx b/frontend/src/pages/Facility3DViewerPage.tsx index e014622..7d7bbd6 100644 --- a/frontend/src/pages/Facility3DViewerPage.tsx +++ b/frontend/src/pages/Facility3DViewerPage.tsx @@ -196,7 +196,17 @@ export default function Facility3DViewerPage() { setBeaconPosition([x, y, z]); setHighlightedTags([result.label]); setDimMode(true); - setSelectedPlant({ ...result.plant, x, y, z }); + // Include breadcrumb data from search result + setSelectedPlant({ + ...result.plant, + x, + y, + z, + breadcrumb: { + room: result.roomName, + section: result.sectionCode, + }, + }); }, [floorData]); // Highlight handler for search typing