diff --git a/web/src/components/plants/PlantCard.tsx b/web/src/components/plants/PlantCard.tsx index 1d88b91..3b10cb4 100644 --- a/web/src/components/plants/PlantCard.tsx +++ b/web/src/components/plants/PlantCard.tsx @@ -49,36 +49,30 @@ export function PlantCard({ return (
setOpen((v) => !v)} - onKeyDown={(e) => { - if (e.target === e.currentTarget && (e.key === 'Enter' || e.key === ' ')) { - e.preventDefault() - setOpen((v) => !v) - } - }} - className={cn( - 'panel relative cursor-pointer px-[18px] py-4 transition-shadow hover:[box-shadow:var(--shadow-md)]', - open && 'border-accent-400', - )} + className={cn('panel relative transition-shadow hover:[box-shadow:var(--shadow-md)]', open && 'border-accent-400')} > -
- - - - {plant.name} + {/* The whole face is the toggle; the expanded area below has its own controls. */} +
+
{lotText}
+ {open && ( - // Stop clicks inside the expanded area from toggling the card. -
e.stopPropagation()} onKeyDown={(e) => e.stopPropagation()}> +
{lots.map((lot) => ( onEditLot(lot)} onDelete={() => onDeleteLot(lot)} /> ))} diff --git a/web/src/editor/store.ts b/web/src/editor/store.ts index 13927de..9f3dd40 100644 --- a/web/src/editor/store.ts +++ b/web/src/editor/store.ts @@ -101,7 +101,8 @@ export const useEditorStore = create((set) => ({ ...TRANSIENT, setSel: (sel) => set({ sel }), setFocus: (id) => set({ focusId: id }), - setArmedKind: (kind) => set({ armedKind: kind, ghost: kind ? undefined : null } as Partial), + // Disarming drops the ghost too; arming keeps whatever the cursor last set. + setArmedKind: (kind) => set((s) => ({ armedKind: kind, ghost: kind ? s.ghost : null })), setArmedPlant: (plant, lotId = null) => set({ armedPlant: plant, armedLotId: plant ? lotId : null }), setArmedLotId: (lotId) => set({ armedLotId: lotId }), setGhost: (ghost) => set({ ghost }),