feat: Toast System & Custom Confirm Modals (OP#948, v0.3.1) #16

Closed
Gravity Bot wants to merge 0 commits from feature/948-toast-confirm-modals into release/v0.3.1
Contributor

Summary

  • OP#949: Custom Alpine.js confirm modal replacing all 8 browser confirm() dialogs via global htmx:confirm intercept, plus htmx:beforeSwap error handler and htmx:sendError network error handler
  • OP#950: Flash cookie pattern (flash_toast cookie) for toast persistence across redirects, success toasts for ~25 redirect handlers, edit-mode drag/drop error toasts
  • OP#951: DB migration adding toast_duration and toast_position to users table, user toast preferences UI in settings page (duration dropdown, position radio buttons), all baseData() methods populate prefs
  • OP#952: Unit tests for TriggerToast header format, FlashToast cookie properties, and URL encoding round-trip

Verification

  • Click a delete button — themed confirm modal appears instead of browser dialog
  • After saving settings, toast appears on the redirected page (flash cookie)
  • Network error shows "server unreachable" toast
  • Edit mode: drag reorder failure shows error toast instead of silent console.error
  • Settings > Appearance > Notifications section: change toast position and duration, save, verify toast appears in new position
  • All go test ./... pass
## Summary - OP#949: Custom Alpine.js confirm modal replacing all 8 browser `confirm()` dialogs via global `htmx:confirm` intercept, plus `htmx:beforeSwap` error handler and `htmx:sendError` network error handler - OP#950: Flash cookie pattern (`flash_toast` cookie) for toast persistence across redirects, success toasts for ~25 redirect handlers, edit-mode drag/drop error toasts - OP#951: DB migration adding `toast_duration` and `toast_position` to users table, user toast preferences UI in settings page (duration dropdown, position radio buttons), all `baseData()` methods populate prefs - OP#952: Unit tests for TriggerToast header format, FlashToast cookie properties, and URL encoding round-trip ## Verification - [ ] Click a delete button — themed confirm modal appears instead of browser dialog - [ ] After saving settings, toast appears on the redirected page (flash cookie) - [ ] Network error shows "server unreachable" toast - [ ] Edit mode: drag reorder failure shows error toast instead of silent console.error - [ ] Settings > Appearance > Notifications section: change toast position and duration, save, verify toast appears in new position - [ ] All `go test ./...` pass ## Links - Epic: [OP#948](https://project.bros.ninja/work_packages/948)
Replace all 8 browser confirm() dialogs with a themed Alpine.js modal.
Add htmx:beforeSwap to block HTML error swaps for 4xx/5xx, htmx:sendError
for network errors, and htmx:confirm interception for custom modal.

Closes OP#949
Refs OP#948

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add FlashToast() using URL-encoded cookies for toast persistence across
redirects. Add success toasts to ~25 handlers. Replace console.error in
edit-mode.js with toast dispatches. Change StatusNoContent to StatusOK
for HX-Redirect paths.

Closes OP#950
Refs OP#948

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add toast_duration and toast_position columns to users table. Update
User model and all 6 SQL scan sites. Add Notifications section to
settings page with duration dropdown and position radio buttons.
Populate BaseData with user toast prefs in all baseData() methods.

Closes OP#951
Refs OP#948

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
test(toast): add unit tests for toast system
All checks were successful
CI / lint (pull_request) Successful in 1m27s
CI / security (pull_request) Successful in 1m47s
CI / build (pull_request) Successful in 1m51s
CI / test (pull_request) Successful in 2m5s
254d363db0
Tests for TriggerToast header format, FlashToast cookie properties
(name, format, MaxAge, HttpOnly=false), and special character
round-tripping through URL encoding.

Closes OP#952
Refs OP#948

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Gravity Bot closed this pull request 2026-02-17 21:20:18 +00:00
All checks were successful
CI / lint (pull_request) Successful in 1m27s
CI / security (pull_request) Successful in 1m47s
CI / build (pull_request) Successful in 1m51s
CI / test (pull_request) Successful in 2m5s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mike/gashy!16
No description provided.