Fix: Throughput API v1 available - Details posted to Irving. POWERBI_KEY was missing from the .ENV file, so was not live.
Add: Editor now supports editing a mix's resolved formula directly, with % and kg dual entry on ingredient rows
Fix: Mix Editor should bring through correct ingredients. New resolved formula (same logic we use in Mix Calculator).
Fix: Security headers on all API responses (hardening)
Add: New mix button available on the Mix Editor.
Add: New ingredient button available on the Ingredient Editor
This commit is contained in:
2026-06-17 21:55:04 +12:00
parent 7db95e2027
commit 3f8279af10
24 changed files with 3820 additions and 37 deletions
+18 -1
View File
@@ -2,11 +2,12 @@
import { api } from '$lib/api';
import { toast } from '$lib/toast';
import AppSecondaryRailLayout from '$lib/components/navigation/AppSecondaryRailLayout.svelte';
import ChangeHistoryModal from '$lib/components/editor/ChangeHistoryModal.svelte';
import SortHeader from '$lib/table/SortHeader.svelte';
import { TableController } from '$lib/table/table.svelte';
import { formatNumber } from '$lib/format';
import type { EditorIngredientRow } from '$lib/types';
import { ChevronLeft, ChevronRight, FlaskConical, ListFilter, Plus, Save, Search, X } from 'lucide-svelte';
import { ChevronLeft, ChevronRight, FlaskConical, History, ListFilter, Plus, Save, Search, X } from 'lucide-svelte';
import { fade } from 'svelte/transition';
let { data } = $props();
@@ -37,6 +38,8 @@
let query = $state('');
let statusFilter = $state<'active' | 'archived' | 'all'>('active');
let savingKey = $state<string | null>(null);
// The ingredient whose change history is open in the modal (null = closed).
let historyIngredient = $state<EditableIngredient | null>(null);
$effect(() => {
if (rows.length === 0 && (data.ingredients as EditorIngredientRow[]).length > 0) {
@@ -380,6 +383,10 @@
</div>
<div class="row-actions">
<button class="clear-button" type="button" onclick={() => (historyIngredient = row)} aria-label={`History for ${row.name}`}>
<History size={16} strokeWidth={2.2} />
History
</button>
<button class="apply-button" type="button" disabled={!rowDirty(row) || savingKey === `row:${row.id}`} onclick={() => saveRow(row)}>
<Save size={16} strokeWidth={2.4} />
{savingKey === `row:${row.id}` ? 'Saving...' : 'Save'}
@@ -406,6 +413,16 @@
{/each}
</div>
</section>
{#if historyIngredient}
<ChangeHistoryModal
entityType="ingredient"
entityId={historyIngredient.id}
title={historyIngredient.name}
subtitle={historyIngredient.unit_of_measure}
onClose={() => (historyIngredient = null)}
/>
{/if}
</AppSecondaryRailLayout>
<style>