fix: include breadcrumb data when selecting plants via search
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

- Add sectionCode to PlantSearch SearchResult
- handleSearchSelect now passes room/section to selectedPlant.breadcrumb
- This makes breadcrumb visible in plant info panel
This commit is contained in:
fullsizemalt 2025-12-19 10:04:56 -08:00
parent 3d57fc96a3
commit 5f65997412
2 changed files with 13 additions and 1 deletions

View file

@ -8,6 +8,7 @@ interface SearchResult {
label: string; label: string;
sublabel: string; sublabel: string;
roomName: string; roomName: string;
sectionCode: string;
position: { position: {
roomX: number; roomX: number;
roomY: number; roomY: number;
@ -51,6 +52,7 @@ export function PlantSearch({ floorData, onSelectResult, onHighlightResults }: P
label: pos.plant.tagNumber, label: pos.plant.tagNumber,
sublabel: `${pos.plant.strain || 'Unknown'}${pos.plant.stage || 'N/A'}`, sublabel: `${pos.plant.strain || 'Unknown'}${pos.plant.stage || 'N/A'}`,
roomName: room.name, roomName: room.name,
sectionCode: section.code || section.name,
position: { position: {
roomX: room.posX, roomX: room.posX,
roomY: room.posY, roomY: room.posY,

View file

@ -196,7 +196,17 @@ export default function Facility3DViewerPage() {
setBeaconPosition([x, y, z]); setBeaconPosition([x, y, z]);
setHighlightedTags([result.label]); setHighlightedTags([result.label]);
setDimMode(true); 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]); }, [floorData]);
// Highlight handler for search typing // Highlight handler for search typing