From dc50e0538efdfbb71565d448bac69141d6c1f66e Mon Sep 17 00:00:00 2001 From: ponzischeme89 Date: Sun, 21 Jun 2026 12:28:23 +1200 Subject: [PATCH] v0.1.35 - Ingredient categories: created categories now available across all rows Co-Authored-By: Claude Opus 4.8 --- backend/pyproject.toml | 2 +- frontend/package-lock.json | 4 ++-- frontend/package.json | 2 +- frontend/src/lib/changelog.ts | 8 +++++++ .../components/editor/CategoryCombobox.svelte | 10 ++++++-- frontend/src/routes/ingredients/+page.svelte | 24 +++++++++++++++---- 6 files changed, 39 insertions(+), 11 deletions(-) diff --git a/backend/pyproject.toml b/backend/pyproject.toml index adbdae8..5b4301c 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "hunter-backend" -version = "0.1.34" +version = "0.1.35" description = "Costing platform MVP backend (API for Hunter)" requires-python = ">=3.11" dependencies = [ diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 9824740..8ae535e 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "hunter-app", - "version": "0.1.34", + "version": "0.1.35", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "hunter-app", - "version": "0.1.34", + "version": "0.1.35", "dependencies": { "@fontsource/inter": "^5.2.8", "lucide-svelte": "^1.0.1" diff --git a/frontend/package.json b/frontend/package.json index 49e8b99..9701c57 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "hunter-app", - "version": "0.1.34", + "version": "0.1.35", "private": true, "type": "module", "scripts": { diff --git a/frontend/src/lib/changelog.ts b/frontend/src/lib/changelog.ts index 0c2f98c..a876f4d 100644 --- a/frontend/src/lib/changelog.ts +++ b/frontend/src/lib/changelog.ts @@ -17,6 +17,14 @@ export type ChangelogEntry = { export const APP_VERSION: string = packageInfo.version; export const changelog: ChangelogEntry[] = [ + { + version: '0.1.35', + date: '2026-06-21', + highlights: [ + 'App: Bug fixes & improvements.', + 'App: General improvements.' + ] + }, { version: '0.1.34', date: '2026-06-21', diff --git a/frontend/src/lib/components/editor/CategoryCombobox.svelte b/frontend/src/lib/components/editor/CategoryCombobox.svelte index dc3d9e5..fde3e93 100644 --- a/frontend/src/lib/components/editor/CategoryCombobox.svelte +++ b/frontend/src/lib/components/editor/CategoryCombobox.svelte @@ -14,7 +14,8 @@ placeholder = 'Category', inputId, disabled = false, - ariaLabel = 'Category' + ariaLabel = 'Category', + oncreate }: { value?: string; options?: string[]; @@ -22,6 +23,9 @@ inputId?: string; disabled?: boolean; ariaLabel?: string; + /** Fired when the user deliberately creates a brand-new category, so the + * parent can keep it available to every other row. */ + oncreate?: (category: string) => void; } = $props(); // `query` is the ephemeral search text; `value` is the committed category. @@ -80,7 +84,9 @@ } function createNew() { - value = trimmed; + const created = trimmed; + value = created; + oncreate?.(created); closeMenu(); } diff --git a/frontend/src/routes/ingredients/+page.svelte b/frontend/src/routes/ingredients/+page.svelte index 21ddfb8..520586c 100644 --- a/frontend/src/routes/ingredients/+page.svelte +++ b/frontend/src/routes/ingredients/+page.svelte @@ -174,14 +174,28 @@ }) ); + // Categories the user has explicitly created via the combobox this session. + // Tracked separately from row values so a freshly-created category stays + // available to every row even before it's been saved to (or assigned on) any + // ingredient — otherwise it would vanish as soon as you moved off the row. + let createdCategories = $state([]); + + function registerCategory(category: string) { + const name = category.trim(); + if (!name) return; + if (createdCategories.some((existing) => existing.toLowerCase() === name.toLowerCase())) return; + createdCategories = [...createdCategories, name]; + } + // Existing categories, offered as autocomplete suggestions so spelling stays // consistent across ingredients. const knownCategories = $derived( Array.from( new Set( - rows - .map((row) => (row.draft_category || row.category || '').trim()) - .filter((value) => value.length > 0) + [ + ...rows.map((row) => (row.draft_category || row.category || '').trim()), + ...createdCategories.map((value) => value.trim()) + ].filter((value) => value.length > 0) ) ).sort((a, b) => a.localeCompare(b)) ); @@ -298,7 +312,7 @@