Page MenuHomePhabricator

Zebra: No-js pinned TOC on small viewports doesnt work
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

When the TOC is pinned, and then the viewport is decreased to below tablet, the grid styles stop applying. Ordinarily JS is used to move the TOC into a dropdown in the page title. However, when JS is turned off, we rely on the checkbox hack and some hacky CSS to absolutely position the TOC and make it look like its part of a dropdown in the page title. This behavior broke with the Zebra design

Expected: https://phab.wmfusercontent.org/file/data/vbva42egrgmkwiwhdvrh/PHID-FILE-ykvw22o55aachw4qwykn/Screenshot_2023-06-27_at_2.04.25_PM.png
Actual: https://phab.wmfusercontent.org/file/data/uey3p2izi5jucr7zqmdi/PHID-FILE-syaplupec2n4mo7u4jcg/Screenshot_2023-06-27_at_2.08.25_PM.png

Proposal

After investigating this issue with @Jdrewniak we werent able to find a simple solution, as the TOC styles are already very complicated. Given this case is such an edge case, we dont think its worth continuing to support and maintain the original "fake dropdown" solution.

Instead, we could simply show the TOC above the page content with a max height

Screenshot 2023-06-27 at 2.12.14 PM.png (1×1 px, 190 KB)
Screenshot 2023-10-16 at 11.28.54 PM.png (1×1 px, 482 KB)
Zebra designStandard design

This would allow us to remove some very unmaintainable HTML/CSS, and also provide the opportunity to use the same solution for browsers that don't support grid (T313066)

QA

On the Vector 2022 skin, (logged-in or out, doesn't matter) check that, on resolutions less than 1000px:

  • The TOC button still collapses into the header
  • The TOC button still remains pinned to the edge of screen when scrolling down

And then with JS disabled, at resolutions less than 1000px

  • The TOC appears above the content, with a max-height of 200px.

QA Results - Beta

ACStatusDetails
1T340571#9270578
2✅ ❓T340571#9270578
3T340571#9270578

QA Results - Prod

ACStatusDetails
1T340571#9297134
2T340571#9297134
3T340571#9297134

Event Timeline

Jdlrobson renamed this task from No-js pinned TOC on small viewports doesnt work in Zebra to Zebra: No-js pinned TOC on small viewports doesnt work.Jun 29 2023, 5:09 PM
Jdlrobson triaged this task as Medium priority.

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

[mediawiki/skins/Vector@master] Simplify TOC design for pinned TOC on no js small viewports

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

LGoto set the point value for this task to 2.Jul 6 2023, 5:41 PM
ovasileva raised the priority of this task from Medium to High.Oct 10 2023, 4:57 PM

Change 933648 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Simplify TOC design for pinned TOC on no js small viewports

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

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS / ❓Need More Info
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

On the Vector 2022 skin, (logged-in or out, doesn't matter) check that, on resolutions less than 1000px:

✅ AC1: The TOC button still collapses into the header

screenshot 102.2.gif (974×1 px, 3 MB)

✅ ❓ AC2: The TOC button still remains pinned to the edge of screen when scrolling down
It does remain pinned to the edge. But on hover it also becomes transparent.
screenshot 103.2.gif (974×996 px, 3 MB)

And then with JS disabled, at resolutions less than 1000px
✅ AC3: The TOC appears above the content, with a max-height of 200px.
screenshot 166.png (973×984 px, 251 KB)

ovasileva claimed this task.
ovasileva subscribed.

Looks good, the transparency issue is tracked under a different ticket. Resolving

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

On the Vector 2022 skin, (logged-in or out, doesn't matter) check that, on resolutions less than 1000px:

✅ AC1: The TOC button still collapses into the header

screenshot 109.mov.gif (734×1 px, 3 MB)

✅ AC2: The TOC button still remains pinned to the edge of screen when scrolling down

screenshot 110.mov.gif (734×998 px, 2 MB)

And then with JS disabled, at resolutions less than 1000px
✅ AC3: The TOC appears above the content, with a max-height of 200px.

screenshot 195.png (736×984 px, 82 KB)