TICKET-008 (frontend): Foods library view — search, pagination, edit, delete, restore

This commit is contained in:
Craig
2026-07-26 17:45:11 +01:00
parent 0c239cdbd4
commit 731e541013
4 changed files with 367 additions and 8 deletions
+7
View File
@@ -14,6 +14,7 @@
import Dashboard from './components/Dashboard.svelte'
import FoodSearch from './components/FoodSearch.svelte'
import FoodEditor from './components/FoodEditor.svelte'
import FoodLibrary from './components/FoodLibrary.svelte'
import BarcodeScanner from './components/BarcodeScanner.svelte'
// Health check — every async view handles loading/error states (spec §8.2 rule 4)
@@ -233,6 +234,9 @@
<button type="button" class="fab scan-fab" onclick={() => { resetScanFlow(); appView.current = 'scan' }}>
📷 Scan
</button>
<button type="button" class="target-btn" onclick={() => appView.current = 'foods'}>
🍔 Foods
</button>
<button type="button" class="target-btn" onclick={openTargetForm}>
🎯 Target
</button>
@@ -337,6 +341,9 @@
{:else if appView.current === 'createFood'}
<FoodEditor />
{:else if appView.current === 'foods'}
<FoodLibrary />
{:else if appView.current === 'editMeal'}
<FoodEditor mealId={mealEdit.foodId} />