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
This commit is contained in:
parent
3d57fc96a3
commit
5f65997412
2 changed files with 13 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue