Auto-dismiss flash messages - #183
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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.
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>
There was a problem hiding this comment.
🟡 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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AutoDismissFlashJS hook: info flashes auto-dismiss after 4s, error flashes after 8s, by replaying a click through the existinglv:clear-flashbinding; manual click-dismiss still works immediately, and hovering pauses the timer.🤖 Generated with Claude Code