Background
There are two main issues with our scroll instrumentation
- Due to a bug in T303297's implementation, extra scroll-to-toc and scroll-to-top events have been firing since https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/773632. This is because we are firing both events whenever either the TOC or page heading are detected by the scrollObserver. Instead, the events should only be fired when their respective element is scrolled to, i.e. only the 'scroll-to-toc' event should be fired when the TOC is scrolled to.
- scroll-to-toc events have not been firing correctly when the TOC scrolls into / out of the viewport on large screen sizes when the A/B test is enabled since https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/777889. This is because the instrumentation originally tracked a TOC placeholder when the modern TOC was shown, but during T300975, the placeholder was replaced with a hidden legacy TOC element, which could not be detected by the scrollObserver.
AC
- 'scroll-to-top' events are only fired when the page header scrolls into or out of the viewport
- 'scroll-to-toc' events are only fired when the TOC scrolls into or out of the viewport
- 'scroll-to-toc' events still fire when the A/B is on, regardless of the user's bucket
QA Results - Beta
AC | Status | Details |
---|---|---|
1 | ✅ | T307952#7948658 |
2 | ✅ | T307952#7948658 |
3 | ✅ | T307952#7948658 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T307952#7981774 |
2 | ✅ | T307952#7981774 |
3 | ✅ | T307952#7981774 |