From 79435602c49f7a22e5fac2bd5b6b150c537bbc71 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Fri, 15 May 2026 08:30:27 +0200 Subject: [PATCH] fix(03): WR-04 add color field error display to create form template - TabloCreateErrors: add Color field for server-side hex validation error - TabloCreateFormFragment: render FieldError for color field and update placeholder to hex-only hint (#6366f1) matching the validation constraint Co-Authored-By: Claude Sonnet 4.6 (1M context) --- backend/templates/tablos.templ | 3 ++- backend/templates/tablos_forms.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/templates/tablos.templ b/backend/templates/tablos.templ index 1a2fba5..26425f7 100644 --- a/backend/templates/tablos.templ +++ b/backend/templates/tablos.templ @@ -139,8 +139,9 @@ templ TabloCreateFormFragment(form TabloCreateForm, errs TabloCreateErrors, csrf name="color" value={ form.Color } class="mt-1 block w-full rounded border border-slate-300 px-3 py-2 text-sm placeholder-slate-400 focus:border-slate-500 focus:outline-none" - placeholder="#6366f1 or indigo" + placeholder="#6366f1" /> + @FieldError(errs.Color)
@ui.Button(ui.ButtonProps{ diff --git a/backend/templates/tablos_forms.go b/backend/templates/tablos_forms.go index e3a4d3f..3408773 100644 --- a/backend/templates/tablos_forms.go +++ b/backend/templates/tablos_forms.go @@ -12,6 +12,7 @@ type TabloCreateForm struct { // create form. A field with an empty string means "no error for this field". type TabloCreateErrors struct { Title string + Color string General string }