guardian / grid

The Guardian’s image management system
https://www.theguardian.com/info/developer-blog/2015/aug/12/open-sourcing-grid-image-service
Apache License 2.0
1.44k stars 120 forks source link

Hide Notification Banner with Scroll Threshold and Device Normalisation Functions #4295

Open shannonmcgurk opened 3 months ago

shannonmcgurk commented 3 months ago

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?