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

Default :info flash is not an Info flash, it is a Success flash #5795

Open
njwest opened this issue Apr 28, 2024 · 0 comments · May be fixed by #5844
Open

Default :info flash is not an Info flash, it is a Success flash #5795

njwest opened this issue Apr 28, 2024 · 0 comments · May be fixed by #5844

Comments

@njwest
Copy link
Contributor

njwest commented Apr 28, 2024

tl;dr :info flashes are not really :info, they're :success.

When I put_flash(conn, :info, message), I don't expect the flash will have green success classes and a "Success!" header.

Example

This code:

Screenshot 2024-04-28 at 3 59 14 PM

Results in this flash:

Screenshot 2024-04-28 at 4 01 34 PM

Whether we want to say the Reset Password operation not erroring out is a success is a matter of professional opinion, but from a pure code perspective, my expectation is put_flash(:info, message) would pop a generic informational flash to the user and :success would pop the "Success!" toast.

Potential improvement

In my own projects I've wired @kind == :success to the "Success!" header and :info to a more vanilla "Info" flash styling/header in the flash/1 core component.

I can attempt to open a PR to add this to the core components and to the generators if desirable. I realize this is a departure from how these flashes have been by default for some time, but IMHO it'll reduce confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant