Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flash ttl #2652

Merged
merged 1 commit into from
Feb 7, 2023
Merged

add flash ttl #2652

merged 1 commit into from
Feb 7, 2023

Conversation

ruslandoga
Copy link
Contributor

@ruslandoga ruslandoga commented Feb 7, 2023

Changes

This PR adds flash :ttl to set the duration in ms that flash is shown. Useful for longer messages like in #2651.

Usage

conn
|> put_flash(:ttl, 8000)
|> put_flash(:error, "some long error message")

Tests

  • This PR does not require tests

Changelog

  • This PR does not make a user-facing change

Documentation

  • This change does not need a documentation update

Dark mode

  • The UI has been tested both in dark and light mode

@bundlemon
Copy link

bundlemon bot commented Feb 7, 2023

BundleMon

Unchanged files (7)
Status Path Size Limits
static/css/app.css
515.18KB -
static/js/dashboard.js
297.69KB -
static/js/app.js
12.13KB -
static/js/embed.host.js
5.58KB -
static/js/embed.content.js
5.06KB -
tracker/js/plausible.js
748B -
static/js/applyTheme.js
314B -

No change in files bundle size

Final result: ✅

View report in BundleMon website ➡️


Current branch size history | Target branch size history

@ruslandoga ruslandoga requested a review from a team February 7, 2023 09:21
@ukutaht
Copy link
Contributor

ukutaht commented Feb 7, 2023

Why make it configurable instead of upping the limit globally?

@ruslandoga
Copy link
Contributor Author

ruslandoga commented Feb 7, 2023

Personal preference :) I tried setting the limit higher, to 8000. It looked fine for the flash with a long message, but the flashes with short messages then appeared to be "stuck". I expect the flash to be shown about as long as it takes for me to read it.

@ukutaht
Copy link
Contributor

ukutaht commented Feb 7, 2023

Fair enough, that makes sense to me :)

@vinibrsl vinibrsl merged commit c3e736a into plausible:master Feb 7, 2023
@ruslandoga ruslandoga deleted the add-flash-ttl branch February 7, 2023 17:04
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.

3 participants