From 43064ccbd7e255b8de91c7ee744df21e724264e2 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Mon, 11 May 2026 03:11:21 +0200 Subject: [PATCH] feat(admin): add htmx toast feedback for settings checkboxes in contenus.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace hx-swap="none" with hx-target on response divs inside each of the three fieldsets (Restrictions d'accès, Degré d'ouverture, Types de travaux) - Add hxToastSuccess / hxToastError helpers in settings.php that return HTML toast fragments with self-referencing auto-dismiss after 3s - Each response div has aria-live="polite" for accessibility - Add comprehensive PHP/JS debugging logs: - settings.php logs raw POST values per field before resolving to 0/1 - checkboxes have hx-on::before-request and hx-on::after-request console.log - global htmx:beforeSend and htmx:sendError listeners in admin footer - toast lifecycle logged (creation + removal) for traceability - Fix toast auto-remove: use getElementById with random unique ID instead of querySelector which could remove wrong toast on rapid clicks - Follows the Django+HTMX ajax checkbox pattern from the reference tutorial feat(admin): add htmx toast feedback for settings checkboxes in contenus.php - Replace hx-swap="none" with hx-target on response divs inside each of the three fieldsets (Restrictions d'accès, Degré d'ouverture, Types de travaux) - Add hxToastSuccess / hxToastError helpers in settings.php that return HTML toast fragments with self-referencing auto-dismiss after 3s - Each response div has aria-live="polite" for accessibility - Add comprehensive PHP/JS debugging logs: - settings.php logs raw POST values per field before resolving to 0/1 - checkboxes have hx-on::before-request and hx-on::after-request console.log - global htmx:beforeSend and htmx:sendError listeners in admin footer - toast lifecycle logged (creation + removal) for traceability - Fix toast auto-remove: use getElementById with random unique ID instead of querySelector which could remove wrong toast on rapid clicks - Fix checkbox unresponsive after toggles: move hidden value="0" inputs outside