diff --git a/web/src/pages/GardenEditorPage.tsx b/web/src/pages/GardenEditorPage.tsx index 1457f5d..b03b754 100644 --- a/web/src/pages/GardenEditorPage.tsx +++ b/web/src/pages/GardenEditorPage.tsx @@ -13,6 +13,7 @@ import { PlantPicker } from '@/editor/PlantPicker' import { Palette } from '@/editor/Palette' import { SeedTray } from '@/editor/SeedTray' import { RecentPlants } from '@/editor/RecentPlants' +import { ScanPacketModal } from '@/components/plants/ScanPacketModal' import { ClearBedModal } from '@/editor/ClearBedModal' import { EditorHint } from '@/editor/EditorHint' import { SeasonBanner, SeasonPicker } from '@/editor/SeasonPicker' @@ -108,6 +109,10 @@ export function GardenEditorPage() { const [picker, setPicker] = useState<'place' | 'change' | null>(null) const [sharing, setSharing] = useState(false) const [clearing, setClearing] = useState(false) + const [scanning, setScanning] = useState(false) + // Whether to offer packet scanning β€” a vision model is configured. Read once + // here so all three Plants-mode entry points gate identically. + const canScan = !!capabilities.data?.vision const nudgeTimer = useRef(null) const nudgeFire = useRef<(() => void) | null>(null) @@ -632,6 +637,8 @@ export function GardenEditorPage() { onClear={() => setClearing(true)} onFill={fillBed} filling={fillObject.isPending} + canScan={canScan} + onScan={() => setScanning(true)} /> ) : ( Not plantable @@ -706,6 +713,8 @@ export function GardenEditorPage() { onClear={() => setClearing(true)} onFill={fillBed} filling={fillObject.isPending} + canScan={!!capabilities.data?.vision} + onScan={() => setScanning(true)} /> + )} + ))} )} @@ -741,6 +761,8 @@ export function GardenEditorPage() { {sharing && setSharing(false)} />} + {scanning && setScanning(false)} />} + {clearing && focusedObject && ( void onFill: (layout: FillLayout) => void filling: boolean + // Scanning a packet adds a variety to the catalog mid-planting; only offered + // where a vision model is configured. + canScan: boolean + onScan: () => void }) { return ( <> @@ -791,6 +819,11 @@ function PlantPlacementTools({ onRemove={onRemove} onOpenPicker={onOpenPicker} /> + {canScan && ( + + )} {armedPlant && } {armedPlant && (