From be43fe94b6324e70d540e96337c2626a281e433e Mon Sep 17 00:00:00 2001 From: Marcel Raddatz Date: Mon, 6 Apr 2026 19:54:25 +0200 Subject: [PATCH] fix(shopping): address frontend review concerns - ChecklistItem: use:enhance with reset:false, role=checkbox, aria-checked, focus ring - RecipeReferencePanel: day abbreviation text-[12px] (was 11px) - ShoppingHeader: generating pending state disables button during submit - AddCustomItem: only collapse form on successful submission Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/lib/shopping/AddCustomItem.svelte | 14 ++++++++------ frontend/src/lib/shopping/ChecklistItem.svelte | 6 ++++-- .../src/lib/shopping/RecipeReferencePanel.svelte | 2 +- frontend/src/lib/shopping/ShoppingHeader.svelte | 15 ++++++++++++--- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/frontend/src/lib/shopping/AddCustomItem.svelte b/frontend/src/lib/shopping/AddCustomItem.svelte index 90b9735..aad6c59 100644 --- a/frontend/src/lib/shopping/AddCustomItem.svelte +++ b/frontend/src/lib/shopping/AddCustomItem.svelte @@ -27,12 +27,14 @@ method="POST" action="?/addItem" use:enhance={() => { - return async ({ update }) => { - await update(); - customName = ''; - quantity = '1'; - unit = ''; - expanded = false; + return async ({ result, update }) => { + if (result.type === 'success') { + await update(); + customName = ''; + quantity = '1'; + unit = ''; + expanded = false; + } }; }} class="flex flex-col gap-2 rounded-[var(--radius-md)] border border-[var(--color-border)] bg-[var(--color-surface)] p-3" diff --git a/frontend/src/lib/shopping/ChecklistItem.svelte b/frontend/src/lib/shopping/ChecklistItem.svelte index 8e443aa..059073c 100644 --- a/frontend/src/lib/shopping/ChecklistItem.svelte +++ b/frontend/src/lib/shopping/ChecklistItem.svelte @@ -32,15 +32,17 @@ ); -
+ async ({ update }) => update({ reset: false })} class="group flex items-center gap-3 py-2">
{/if}