fix: keep flash notices below the nav and close info ones on a timer #83

Merged
jfro merged 1 commit from fix/flash-below-nav into main 2026-10-25 21:57:05 +00:00
Owner

Closes #74

What changed

  • Flash notices sit just below the navbar (top-18, the navbar is ~67px) instead of over it. The batch scanner's own toast stack gets the same offset.
  • Info flashes close themselves after 7s (info_timeout attr on flash_group, default 7000). The timer pauses while the flash is hovered or focused. Error flashes stay until closed.
  • New assets/js/flash.js: arms flashes on controller pages at load, and an AutoDismissFlash LiveView hook for flashes a LiveView renders. Dismissing clicks the flash's own close button, so LiveViews clear the flash server-side (lv:clear-flash) as before.

Tested

  • New tests in layouts_test.exs: info flash carries the hook + timeout and the offset; error flash doesn't auto-dismiss; timeout is configurable.
  • Browser check (Chromium, 1280×800 and 390×844): flash top is below the navbar's bottom and on screen; info flash still visible at 3s, gone by 8s; error flash still there after 9s and closes on ✕; admin LiveView connects with no JS errors.
  • mix precommit passes (638 tests).
Closes #74 **What changed** - Flash notices sit just below the navbar (`top-18`, the navbar is ~67px) instead of over it. The batch scanner's own toast stack gets the same offset. - Info flashes close themselves after 7s (`info_timeout` attr on `flash_group`, default 7000). The timer pauses while the flash is hovered or focused. Error flashes stay until closed. - New `assets/js/flash.js`: arms flashes on controller pages at load, and an `AutoDismissFlash` LiveView hook for flashes a LiveView renders. Dismissing clicks the flash's own close button, so LiveViews clear the flash server-side (`lv:clear-flash`) as before. **Tested** - New tests in `layouts_test.exs`: info flash carries the hook + timeout and the offset; error flash doesn't auto-dismiss; timeout is configurable. - Browser check (Chromium, 1280×800 and 390×844): flash top is below the navbar's bottom and on screen; info flash still visible at 3s, gone by 8s; error flash still there after 9s and closes on ✕; admin LiveView connects with no JS errors. - `mix precommit` passes (638 tests).
jfro added this to the v0.9.0 milestone 2026-10-25 20:56:13 +00:00
fix: keep flash notices below the nav and close info ones on a timer
All checks were successful
CI / test (pull_request) Successful in 49s
63134597cc
Flashes (and the batch scanner's toasts) now sit just below the navbar
instead of over it. Info flashes close themselves after 7s, pausing while
hovered or focused; errors stay until closed. Works on controller pages
and in LiveViews (AutoDismissFlash hook).

Closes #74
jfro merged commit 49ff152b5b into main 2026-10-25 21:57:05 +00:00
jfro deleted branch fix/flash-below-nav 2026-10-25 21:57:06 +00:00
Sign in to join this conversation.
No reviewers
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
jfro/fuzzy_catalog!83
No description provided.