From 3b1317af98ffef0a67d7c652b17fbbd531e74ca4 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 17 Apr 2026 10:22:54 +0200 Subject: [PATCH] fix(admin-tags): name clears after save and wrong confirmation text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SvelteKit's use:enhance resets the form after a successful action. The name input used value={data.tag.name} without bind:, so Svelte 5's fine-grained reactivity did not re-apply the unchanged value after the reset — leaving the field empty. Passing reset: false to update() fixes this. Also corrected the confirmation message from "renamed" to "saved" in all three locales, since the action updates name, parent, and color. Co-Authored-By: Claude Sonnet 4.6 --- frontend/messages/de.json | 2 +- frontend/messages/en.json | 2 +- frontend/messages/es.json | 2 +- frontend/src/routes/admin/tags/[id]/+page.svelte | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/messages/de.json b/frontend/messages/de.json index 22b5406b..d043357a 100644 --- a/frontend/messages/de.json +++ b/frontend/messages/de.json @@ -180,7 +180,7 @@ "admin_tags_empty": "Keine Schlagworte vorhanden.", "admin_tags_select_prompt": "Wähle ein Schlagwort aus der Liste.", "admin_tag_edit_heading": "Schlagwort: {name}", - "admin_tag_updated": "Schlagwort umbenannt.", + "admin_tag_updated": "Schlagwort gespeichert.", "admin_unsaved_warning": "Du hast ungespeicherte Änderungen – speichere oder verwerfe, bevor du wechselst.", "admin_btn_collapse_list": "Liste einklappen", "admin_btn_expand_list": "Liste ausklappen", diff --git a/frontend/messages/en.json b/frontend/messages/en.json index 4c847bcb..5e79d77a 100644 --- a/frontend/messages/en.json +++ b/frontend/messages/en.json @@ -180,7 +180,7 @@ "admin_tags_empty": "No tags found.", "admin_tags_select_prompt": "Select a tag from the list.", "admin_tag_edit_heading": "Tag: {name}", - "admin_tag_updated": "Tag renamed.", + "admin_tag_updated": "Tag saved.", "admin_unsaved_warning": "You have unsaved changes — save or discard before switching.", "admin_btn_collapse_list": "Collapse list", "admin_btn_expand_list": "Expand list", diff --git a/frontend/messages/es.json b/frontend/messages/es.json index 47f6e8df..0b3e078b 100644 --- a/frontend/messages/es.json +++ b/frontend/messages/es.json @@ -180,7 +180,7 @@ "admin_tags_empty": "No hay etiquetas.", "admin_tags_select_prompt": "Selecciona una etiqueta de la lista.", "admin_tag_edit_heading": "Etiqueta: {name}", - "admin_tag_updated": "Etiqueta renombrada.", + "admin_tag_updated": "Etiqueta guardada.", "admin_unsaved_warning": "Tienes cambios sin guardar — guarda o descarta antes de cambiar.", "admin_btn_collapse_list": "Contraer lista", "admin_btn_expand_list": "Expandir lista", diff --git a/frontend/src/routes/admin/tags/[id]/+page.svelte b/frontend/src/routes/admin/tags/[id]/+page.svelte index 51a0ce27..2172ec25 100644 --- a/frontend/src/routes/admin/tags/[id]/+page.svelte +++ b/frontend/src/routes/admin/tags/[id]/+page.svelte @@ -119,7 +119,7 @@ const colors = [ id="edit-tag-form" method="POST" action="?/update" - use:enhance + use:enhance={() => async ({ update }) => { await update({ reset: false }); }} oninput={unsaved.markDirty} class="mb-5" >