From 3b35e835c839ee4e1c03f149aac8f46c01d0f144 Mon Sep 17 00:00:00 2001 From: Bonna Moon Date: Mon, 29 Jun 2026 17:58:04 -0500 Subject: [PATCH] =?UTF-8?q?v0.19.1=20=E2=80=94=20Pantry:=20quantity=20step?= =?UTF-8?q?pers=20go=20by=20whole=20numbers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed step from 0.25 to 1 on the Quantity and "how much are you using" number inputs so the spinner arrows move by wholes. Added noValidate on both forms (native step-mismatch validation would otherwise block submitting typed partials like 2.5) plus manual amount-bounds checks in the use dialog to replace the native min/max constraints that noValidate disables. Co-Authored-By: Claude Sonnet 4.6 --- src/components/pantry/pantry-item-dialog.tsx | 4 ++-- src/components/pantry/use-item-dialog.tsx | 16 ++++++++++++---- src/lib/changelog.ts | 7 +++++++ src/lib/version.ts | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/components/pantry/pantry-item-dialog.tsx b/src/components/pantry/pantry-item-dialog.tsx index 6b4bdc1..4962196 100644 --- a/src/components/pantry/pantry-item-dialog.tsx +++ b/src/components/pantry/pantry-item-dialog.tsx @@ -224,7 +224,7 @@ export function PantryItemDialog({ item, locations, plants, onSuccess }: Props) {item ? "Edit item" : "Add pantry item"} -
+ {/* Name with autocomplete */}
@@ -308,7 +308,7 @@ export function PantryItemDialog({ item, locations, plants, onSuccess }: Props)
- set("quantity", e.target.value)} required /> + set("quantity", e.target.value)} required />
diff --git a/src/components/pantry/use-item-dialog.tsx b/src/components/pantry/use-item-dialog.tsx index 60a1052..75782d9 100644 --- a/src/components/pantry/use-item-dialog.tsx +++ b/src/components/pantry/use-item-dialog.tsx @@ -31,6 +31,15 @@ export function UseItemDialog({ item, onSuccess }: { item: PantryItem; onSuccess async function handleSubmit(e: React.FormEvent) { e.preventDefault(); + const parsed = parseFloat(amount); + if (!parsed || parsed <= 0) { + setError("Enter an amount greater than 0"); + return; + } + if (parsed > item.quantity) { + setError(`Only ${item.quantity} ${item.unit ?? ""} on hand`.trim()); + return; + } setSaving(true); setError(null); try { @@ -65,7 +74,7 @@ export function UseItemDialog({ item, onSuccess }: { item: PantryItem; onSuccess Use {item.name} - +

Currently: {item.quantity} {item.unit ?? ""}

@@ -74,9 +83,8 @@ export function UseItemDialog({ item, onSuccess }: { item: PantryItem; onSuccess setAmount(e.target.value)} required diff --git a/src/lib/changelog.ts b/src/lib/changelog.ts index a2c489b..c27e0c9 100644 --- a/src/lib/changelog.ts +++ b/src/lib/changelog.ts @@ -8,6 +8,13 @@ export type ChangelogEntry = { }; export const CHANGELOG: ChangelogEntry[] = [ + { + version: "0.19.1", + date: "2026-06-29", + changes: [ + "Pantry: the quantity up/down arrows now step by whole numbers instead of quarters — you can still type a partial amount like 2.5 directly.", + ], + }, { version: "0.19.0", date: "2026-06-29", diff --git a/src/lib/version.ts b/src/lib/version.ts index 9f96100..bbd3986 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -1,2 +1,2 @@ // Bump on every user-visible release. Changelog entries live in `src/lib/changelog.ts`. -export const APP_VERSION = "0.19.0"; +export const APP_VERSION = "0.19.1";