Skip to content

Auto-dismiss flash messages - #183

Merged
bbangert merged 3 commits into
mainfrom
fix/flash-auto-dismiss
Aug 21, 2026
Merged

Auto-dismiss flash messages#183
bbangert merged 3 commits into
mainfrom
fix/flash-auto-dismiss

Conversation

@bbangert

Copy link
Copy Markdown
Owner

Summary

  • Flash messages (e.g. the eject "safe to unplug now" toast) never cleared on their own — HW feedback from Ben.
  • Added an AutoDismissFlash JS hook: info flashes auto-dismiss after 4s, error flashes after 8s, by replaying a click through the existing lv:clear-flash binding; manual click-dismiss still works immediately, and hovering pauses the timer.

🤖 Generated with Claude Code

Flashes stayed until clicked or a page reload — the eject "safe to
unplug" toast never cleared. A small hook dismisses info flashes after
4s and errors after 8s, click still works, hover pauses the timer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds timed auto-dismissal for LiveView flash messages while retaining manual dismissal.

Changes:

  • Adds 4-second info and 8-second error timeouts.
  • Adds a JavaScript hook with hover-based timer control.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
assets/js/app.js Implements flash auto-dismiss timers.
lib/universal_proxy_web/components/layouts.ex Connects flash elements to the hook and configures timeouts.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread assets/js/app.js Outdated
Comment thread assets/js/app.js
Keyboard/AT users can now tab onto a flash (tabindex=0) to pause the
timer via focusin/focusout, sharing the hover pause logic; and since a
same-kind flash patches into the fixed-id element, updated() restarts
the countdown so a stale timer can't dismiss the new message early.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Overlapping hover and focus states can incorrectly resume dismissal while a user is still reading the flash.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread assets/js/app.js Outdated
Leaving one pause condition resumed the countdown while the other was
still active; the timer now restarts only when neither the pointer nor
focus is on the flash.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@bbangert
bbangert merged commit 585872a into main Aug 21, 2026
6 checks passed
@bbangert
bbangert deleted the fix/flash-auto-dismiss branch August 21, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants