Show new flash messages until discarded by user #10319
Merged
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.
What? Why?
We currently have two mechanisms to display flash messages. The old one through AngularJS and the new one with StimulusReflex.
The AngularJS directive showed flashes for 10 seconds. The StimulusReflex controller showed them only for 3 seconds. But any time based disappearance of error messages is problematic. There's important information in there and some error messages can be long. It's also possible that a request takes a while, the user leaves the computer and comes back later. If we hide the flash automatically then the user may have no idea what went wrong. They may even think that everything is fine and their order went through.
I removed the time-based removal of flash messages from the new StimulusReflex controller to address this problem. But I didn't touch the AngularJS directive because it will be removed anyway. There may also be many more messages that could be annoying if they didn't disappear, for example a simple "login successful".
I personally think that flash messages that are not important to keep, don't need to be shown in the first place. The best UX makes the success obvious on the page. And success should be assumed.
Relates to:
What should we test?
Release notes
Changelog Category: User facing changes
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates