Seed shelf UI: source links, lots, and what's left (#51)
#50 stores provenance and lots; this is where you actually use them. That question gets asked twice — at the seed rack in January, and standing over a bed in May — so the answer shows up in both places. On the plant card: vendor and a source link, plus a seed count that sits with the actions rather than in the body, because it's what you scan down a list of twenty packets deciding what to order. Expanding shows each lot separately with vendor, dates, germination, cost, and its own remaining count — two lots of one variety are two rows with independent numbers, which is the whole reason inventory lives on the purchase rather than on the plant. State is encoded in form as well as number: a coloured chip that says "low" or "empty" in words, and a proportional bar. A bare number doesn't survive being skimmed, and skimming is the actual use. "Over-planted" is a state of its own rather than being clamped to zero — planting more than you recorded buying happens, and hiding it defeats the point of tracking. In the plant picker, remaining shows next to the plant you're about to place, and a plant with several lots asks which packet it came out of. One lot auto-attributes and zero lots stays silent: forcing that question on every placement is how a nicety becomes an obstacle. The armed lot rides along with the armed plant, so repeat placement keeps attributing without asking again. External URLs are re-checked client-side before being rendered as links, and carry rel="noopener noreferrer". The server already scheme-checks them, but a link is rendered from whatever the client was handed — an old row, a different server version, a tampered response — and "the backend validated it" is not a reason to hand javascript: to an anchor tag. Retiring a lot says plainly that the plantings survive it, since "will this wipe my garden" is the reasonable fear. Closes #51 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01H3zbym8Doka2d7D48maSgZ
This commit is contained in:
@@ -258,6 +258,8 @@ export interface PlantingCreate {
|
||||
radiusCm: number
|
||||
count?: number | null
|
||||
label?: string | null
|
||||
/** Attributes the plop to a purchase, so that lot can report what's left. */
|
||||
seedLotId?: number
|
||||
}
|
||||
|
||||
export function useCreatePlanting(gardenId: number) {
|
||||
|
||||
Reference in New Issue
Block a user