xtablo-source/backend/internal/web
Arthur Belleville 38fe5b3909
fix(03): CR-02 capture user from loadOwnedTablo on update error path
- TabloUpdateHandler: capture user from loadOwnedTablo (was discarded with _)
- Pass captured user to TabloDetailPage on non-HTMX validation error path
  instead of nil, preventing broken layout (no logout button/email shown)
- TabloUpdateHandler: pass tablo.Color to UpdateTablo to preserve color on update (CR-01)
- loadOwnedTablo: pass GetTabloByIDParams{ID, UserID} to DB query (WR-01 call site)
- TabloDeleteHandler: pass DeleteTabloParams{ID, UserID} to DB query (WR-02 call site)
- TabloDeleteHandler: on DB error with HX-Request, render TabloDeleteConfirmFragment
  instead of plain http.Error to avoid broken HTMX DOM state (CR-03)
- renderTabloCreateError: log secondary ListTablosByUser fetch failure (WR-03)
- TablosCreateHandler: validate color with isValidCSSColor (hex only) and surface
  TabloCreateErrors.Color field error to prevent CSS injection (WR-04)
- Add isValidCSSColor helper using ^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$ regex
- Update test call sites for GetTabloByID and DeleteTablo new param types

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-05-15 08:30:22 +02:00
..
ui feat(03-01): add ui-button-solid-danger-md and ui-button-soft-neutral-md CSS variants 2026-05-15 00:13:56 +02:00
csrf_debug_test.go feat(02-07): gorilla/csrf integration — mount middleware, wire all forms, env-driven key 2026-05-14 22:59:06 +02:00
csrf_test.go test(03-01): add TablosDeps stub and RED integration test scaffold for TABLO-01..06 2026-05-15 00:13:31 +02:00
handlers.go feat(03-02): tablo handlers + router wiring — list/new/create green 2026-05-15 00:20:25 +02:00
handlers_auth.go feat(02-07): gorilla/csrf integration — mount middleware, wire all forms, env-driven key 2026-05-14 22:59:06 +02:00
handlers_auth_test.go test(03-01): add TablosDeps stub and RED integration test scaffold for TABLO-01..06 2026-05-15 00:13:31 +02:00
handlers_tablos.go fix(03): CR-02 capture user from loadOwnedTablo on update error path 2026-05-15 08:30:22 +02:00
handlers_tablos_test.go fix(03): CR-02 capture user from loadOwnedTablo on update error path 2026-05-15 08:30:22 +02:00
handlers_test.go test(03-01): add TablosDeps stub and RED integration test scaffold for TABLO-01..06 2026-05-15 00:13:31 +02:00
middleware.go feat(01-03): pgxpool wrapper, RequestID/slog middleware, slog handler switch 2026-05-14 19:24:16 +02:00
router.go feat(03-03): detail/edit/delete handlers + router wiring; all 10 TABLO tests green 2026-05-15 08:02:43 +02:00
slog.go feat(01-03): pgxpool wrapper, RequestID/slog middleware, slog handler switch 2026-05-14 19:24:16 +02:00
testdb_test.go feat(02-04): signup handler, router wiring, and integration tests 2026-05-14 22:17:50 +02:00