Fix plant placement flow + add a Seed Tray for quick placing #39

Closed
opened 2026-07-19 05:46:54 +00:00 by steve · 0 comments
Owner

Bug: selecting a plant in the picker does nothing

Repro: focus a bed → "+ Add plant" → pick a plant that has never been placed in this garden → picker stays open, nothing is armed; closing it and tapping the bed just moves the bed.

Root cause: GardenEditorPage.onPickPlant resolves the chosen plant via plantsById, which is built from full.data.plants = store.ListReferencedPlants (only plants already used in the garden). The PlantPicker offers the full catalog (usePlants()), so a not-yet-referenced plant isn't in the map → the handler returns early, before setArmedPlant and before setPicker(null).

Fix: use the full Plant object the picker already provides; splice it into the garden-full cache plants array so a placed plop renders with its icon/color before the next refetch.

Feature: Seed Tray (quick list)

A persistent, per-garden row of plant chips in the focus-mode toolbar: tap a chip to arm that plant immediately (skip the picker); picking from the catalog adds it to the tray; a small ✕ removes it. Persisted in localStorage (mirrors the existing "recent plants" mechanism). Makes repeat placement of a known set of plants fast.

From a direct request during a working session.

## Bug: selecting a plant in the picker does nothing Repro: focus a bed → "+ Add plant" → pick a plant that has never been placed in this garden → picker stays open, nothing is armed; closing it and tapping the bed just moves the bed. Root cause: `GardenEditorPage.onPickPlant` resolves the chosen plant via `plantsById`, which is built from `full.data.plants` = `store.ListReferencedPlants` (only plants already used in the garden). The `PlantPicker` offers the **full** catalog (`usePlants()`), so a not-yet-referenced plant isn't in the map → the handler `return`s early, before `setArmedPlant` and before `setPicker(null)`. Fix: use the full `Plant` object the picker already provides; splice it into the `garden-full` cache `plants` array so a placed plop renders with its icon/color before the next refetch. ## Feature: Seed Tray (quick list) A persistent, per-garden row of plant chips in the focus-mode toolbar: tap a chip to arm that plant immediately (skip the picker); picking from the catalog adds it to the tray; a small ✕ removes it. Persisted in `localStorage` (mirrors the existing "recent plants" mechanism). Makes repeat placement of a known set of plants fast. From a direct request during a working session.
steve closed this issue 2026-07-19 06:09:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: steve/pansy#39