-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 kind for successful interactions #5969
base: main
Are you sure you want to change the base?
Conversation
c6c88e7
to
12c9888
Compare
Hi @rmoorman, |
Oh my! @SteffenDE , I indeed didn't see that. I suppose @josevalim didn't have a change of heart yet in this matter? 😄 IMHO it is likely that at least one neutral message kind/style is often needed (instead of green). On one hand this could be added (like in this PR at the moment). In case it would be feasible/wanted to move this forward, of course I would also amend the inline documentation. But on the other hand, indeed the Just let me know how you would like me to proceed. |
12c9888
to
6f4838c
Compare
Personally I think this introduces a very useful and intuitive option that most people would likely self-implement. An "official" option makes total sense. |
In order to move this forward, I'd say let's just change info to use sky (I visually prefer it to blue): https://play.tailwindcss.com/Bn7JbDMpq4 People can easily extend their flash types themselves. If the docs aren't clear enough, we should improve those (see also phoenixframework/phoenix_live_view#3344) :) |
@SteffenDE agreed. |
I will change the color to sky then. |
6f4838c
to
464e75a
Compare
Introduce a `:success` kind for flash messages in the generator output and update relevant documentation. Success messages that previously used `:info` now use `:success`, ensuring they continue to appear in green with a "Success!" title. The icon for success messages is now a checkmark. Info messages do now appear in blue with the title "Info". In certain cases (e.g. password reset), `:info` is retained to avoid disclosing too much information (such as the existence of an account). Rationale for those changes: - Differentiate informational messages from successful actions - Avoid confusion from informational messages styled in green, which can imply success - Ensure `:info` is used for neutral messages, and use `:success` to clearly indicate completed actions
464e75a
to
78529c7
Compare
Update the documentation to match the changes introduced in phoenixframework/phoenix#5969
So I went on and did the following
|
@rmoorman I think there was a misunderstanding. With my comment I wanted to say that we should keep just info and error for now, but adjust info to be less "successy", i.e., change it from green to blue. Instead of the dark blue my preference was the lighter sky blue. I do see that I didn't express this as clearly as I should have, so now I'm myself not sure if that's also what @josevalim agreed on 😅 |
@SteffenDE I am in agreement with you :) That's what I had in mind too (just change the color). |
So, you want the following adjustments @SteffenDE and/or @josevalim:
Is that correct? (P.s. I still really find it a pity because (as others mentioned as well) it seems to be a common thing to have) |
@rmoorman yes! |
I think the reasoning here for not adding success is phoenix has already been using --- @SteffenDE feel free to chime in if I have misspoken here. and I agree with this, live view currently doesn't have any strong opinions, if you want to add a success type to flashes, its relatively straight forward, and for all the generated code, you still have the ability to change it, the framework isn't stopping you in any way to use |
Introduce a
:success
kind for flash messages in the generator output and update relevant documentation.Success messages that previously used
:info
now use:success
, ensuring they continue to appear in green with a "Success!" title.The icon for success messages is now a checkmark.
Info messages do now appear in blue with the title "Info".
In certain cases (e.g. password reset),
:info
is retained to avoid disclosing too much information (such as the existence of an account).Rationale for those changes:
Differentiate informational messages from successful actions
Avoid confusion from informational messages styled in green, which
can imply success
Ensure
:info
is used for neutral messages, and use:success
toclearly indicate completed actions