diff --git a/web/src/pages/GardenEditorPage.tsx b/web/src/pages/GardenEditorPage.tsx index 1457f5d..29afb38 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,7 @@ 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) const nudgeTimer = useRef(null) const nudgeFire = useRef<(() => void) | null>(null) @@ -632,6 +634,8 @@ export function GardenEditorPage() { onClear={() => setClearing(true)} onFill={fillBed} filling={fillObject.isPending} + canScan={!!capabilities.data?.vision} + onScan={() => setScanning(true)} /> ) : ( Not plantable @@ -706,6 +710,8 @@ export function GardenEditorPage() { onClear={() => setClearing(true)} onFill={fillBed} filling={fillObject.isPending} + canScan={!!capabilities.data?.vision} + onScan={() => setScanning(true)} /> + )} + ))} )} @@ -741,6 +758,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 +816,11 @@ function PlantPlacementTools({ onRemove={onRemove} onOpenPicker={onOpenPicker} /> + {canScan && ( + + )} {armedPlant && } {armedPlant && (