From df6200d858917c7cdbc337990394403869650f70 Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Wed, 22 Jul 2026 13:24:37 -0400 Subject: [PATCH] Hoist the vision-capability flag to one canScan local Review nit: capabilities.data?.vision was read inline at all three Plants-mode scan entry points. Read it once into `canScan` so the gating is consistent. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01H3zbym8Doka2d7D48maSgZ --- web/src/pages/GardenEditorPage.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/src/pages/GardenEditorPage.tsx b/web/src/pages/GardenEditorPage.tsx index 29afb38..b03b754 100644 --- a/web/src/pages/GardenEditorPage.tsx +++ b/web/src/pages/GardenEditorPage.tsx @@ -110,6 +110,9 @@ export function GardenEditorPage() { 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) @@ -634,7 +637,7 @@ export function GardenEditorPage() { onClear={() => setClearing(true)} onFill={fillBed} filling={fillObject.isPending} - canScan={!!capabilities.data?.vision} + canScan={canScan} onScan={() => setScanning(true)} /> ) : ( @@ -732,7 +735,7 @@ export function GardenEditorPage() { ) : (

Tap a bed, then “🌱 Plant here” to start planting.

- {capabilities.data?.vision && ( + {canScan && (