Page MenuHomePhabricator

Vector isnt firing 'scroll-to-toc' and 'scroll-to-top' events correctly
Closed, ResolvedPublic

Description

Background

There are two main issues with our scroll instrumentation

  1. 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.
  1. 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

ACStatusDetails
1T307952#7948658
2T307952#7948658
3T307952#7948658

QA Results - Prod

ACStatusDetails
1T307952#7981774
2T307952#7981774
3T307952#7981774

Event Timeline

bwang renamed this task from 'scroll-to-toc' and 'scroll-to-top' events aren' to Vector isnt firing 'scroll-to-toc' and 'scroll-to-top' events correctly .May 9 2022, 7:58 PM
bwang updated the task description. (Show Details)
bwang added subscribers: cjming, ovasileva.
bwang added a subscriber: jwang.

Change 789684 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Factor out a separate scroll observer for the TOC A/B test, which should be fired separately from the page title observer used by the sticky header and TOC

https://gerrit.wikimedia.org/r/789684

Change 789684 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Factor out a separate scroll observer for the TOC A/B test, which should be fired separately from the page title observer used by the sticky header and TOC

https://gerrit.wikimedia.org/r/789684

Change 790443 had a related patch set uploaded (by Clare Ming; author: Bernard Wang):

[mediawiki/skins/Vector@wmf/1.39.0-wmf.10] Factor out a separate scroll observer for the TOC A/B test, which should be fired separately from the page title observer used by the sticky header and TOC

https://gerrit.wikimedia.org/r/790443

Change 790443 merged by jenkins-bot:

[mediawiki/skins/Vector@wmf/1.39.0-wmf.10] Factor out a separate scroll observer for the TOC A/B test, which should be fired separately from the page title observer used by the sticky header and TOC

https://gerrit.wikimedia.org/r/790443

Mentioned in SAL (#wikimedia-operations) [2022-05-11T20:25:50Z] <cjming@deploy1002> Synchronized php-1.39.0-wmf.10/skins/Vector/resources: Backport: [[gerrit:790443|Factor out a separate scroll observer for the TOC A/B test, which should be fired separately from the page title observer used by the sticky header and TOC (T307952 T307345)]] (duration: 00m 52s)

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: 'scroll-to-top' events are only fired when the page header scrolls into or out of the viewport

Screen Shot 2022-05-22 at 6.08.26 PM.png (279×748 px, 52 KB)

✅ AC2: 'scroll-to-toc' events are only fired when the TOC scrolls into or out of the viewport
Screen Shot 2022-05-22 at 6.08.01 PM.png (259×749 px, 47 KB)

Screen Shot 2022-05-22 at 6.07.40 PM.png (214×668 px, 39 KB)

Screen Shot 2022-05-22 at 6.07.25 PM.png (257×721 px, 48 KB)

✅ AC3: 'scroll-to-toc' events still fire when the A/B is on, regardless of the user's bucket
Screen Shot 2022-05-22 at 6.07.05 PM.png (265×704 px, 47 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki, euwiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: 'scroll-to-top' events are only fired when the page header scrolls into or out of the viewport
See AC2
✅ AC2: 'scroll-to-toc' events are only fired when the TOC scrolls into or out of the viewport

Screen Recording 2022-06-05 at 6.09.37 PM.mov.gif (1×1 px, 3 MB)

✅ AC3: 'scroll-to-toc' events still fire when the A/B is on, regardless of the user's bucket

Screen Recording 2022-06-05 at 6.15.20 PM.mov.gif (1×1 px, 2 MB)