Skip to content

add flash ttl - #2652

Merged
vinibrsl merged 1 commit into
plausible:masterfrom
ruslandoga:add-flash-ttl
Feb 7, 2023
Merged

vinibrsl merged 1 commit into
plausible:masterfrom
ruslandoga:add-flash-ttl

Conversation

@ruslandoga

@ruslandoga ruslandoga commented Feb 7, 2023 •

Copy link
Copy Markdown
Contributor

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

@ruslandoga ruslandoga mentioned this pull request Feb 7, 2023
4 tasks done
@bundlemon

bundlemon Bot commented Feb 7, 2023

Copy link
Copy Markdown

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

ukutaht commented Feb 7, 2023

Copy link
Copy Markdown
Contributor

Why make it configurable instead of upping the limit globally?

@ruslandoga

ruslandoga commented Feb 7, 2023 •

Copy link
Copy Markdown
Contributor Author

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

ukutaht commented Feb 7, 2023

Copy link
Copy Markdown
Contributor

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