From c449b0c2aea5e711b366617b5238f5c5c08339dd Mon Sep 17 00:00:00 2001 From: Bonna Moon Date: Mon, 29 Jun 2026 17:49:37 -0500 Subject: [PATCH] =?UTF-8?q?v0.18.1=20patch=20=E2=80=94=20Pantry:=20locatio?= =?UTF-8?q?n=20dropdown=20shows=20Kitchen=20only?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Filter locations to Kitchen and its children (fridge, freezer, pantry shelves, etc.). Display the full path so "Kitchen › Freezer" shows instead of just "Freezer". Co-Authored-By: Claude Sonnet 4.6 --- src/app/(dashboard)/kitchen/pantry/page.tsx | 12 +++++++++++- src/components/pantry/pantry-client.tsx | 2 +- src/components/pantry/pantry-item-dialog.tsx | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/app/(dashboard)/kitchen/pantry/page.tsx b/src/app/(dashboard)/kitchen/pantry/page.tsx index 1bbee37..71d21c3 100644 --- a/src/app/(dashboard)/kitchen/pantry/page.tsx +++ b/src/app/(dashboard)/kitchen/pantry/page.tsx @@ -17,7 +17,17 @@ export default async function PantryPage() { plant: { select: { id: true, commonName: true, variety: true } }, }, }), - db.location.findMany({ where: { active: true }, orderBy: { name: "asc" }, select: { id: true, name: true } }), + db.location.findMany({ + where: { + active: true, + OR: [ + { name: { equals: "Kitchen", mode: "insensitive" } }, + { path: { contains: "Kitchen", mode: "insensitive" } }, + ], + }, + orderBy: { path: "asc" }, + select: { id: true, name: true, path: true }, + }), db.plant.findMany({ where: { active: true }, orderBy: { commonName: "asc" }, select: { id: true, commonName: true, variety: true } }), ]); diff --git a/src/components/pantry/pantry-client.tsx b/src/components/pantry/pantry-client.tsx index 1b77666..0daec43 100644 --- a/src/components/pantry/pantry-client.tsx +++ b/src/components/pantry/pantry-client.tsx @@ -26,7 +26,7 @@ export type PantryItem = { notes: string | null; }; -export type LocationOption = { id: string; name: string }; +export type LocationOption = { id: string; name: string; path: string | null }; export type PlantOption = { id: string; commonName: string; variety: string | null }; const SOURCE_LABELS: Record = { diff --git a/src/components/pantry/pantry-item-dialog.tsx b/src/components/pantry/pantry-item-dialog.tsx index a1aefed..6b4bdc1 100644 --- a/src/components/pantry/pantry-item-dialog.tsx +++ b/src/components/pantry/pantry-item-dialog.tsx @@ -341,7 +341,7 @@ export function PantryItemDialog({ item, locations, plants, onSuccess }: Props)