Hide Notification Banner with Scroll Threshold and Device Normalisation Functions #4295
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 does this change?
This change improves the transient notification banner's behaviour by introducing a function to hide the banner after the user performs certain actions: when the user presses the up arrow, the down arrow, or scrolls using the mouse wheel or trackpad. The scroll threshold is set at a magnitude of 10, ensuring that the banner remains visible during minor or accidental scrolls. A function to normalise the wheel action of the scroll has also been implemented to ensure a consistent user experience across different devices and browser settings.
How should a reviewer test this change?
Trigger the transient notification banner to appear.
Press the up arrow or down arrow and confirm that the banner hides.
Scroll using the mouse wheel or trackpad with a magnitude below the threshold (10) and confirm that the banner remains visible.
Scroll using the mouse wheel or trackpad with a magnitude above the threshold (10) and confirm that the banner hides.
Test the behaviour across different devices and browsers to verify the normalisation function works correctly.
Tested? Documented?