Page MenuHomePhabricator

Make TOC pinned body class use `vector-feature-toc-pinned-enabled`/`vector-feature-toc-pinned-disabled` convention
Closed, ResolvedPublic5 Estimated Story Points

Description

Adding persistence to the page tools feature (T322051) made pinnableElement.js delegate to features.js to handle the toggling of the body class. However, this also diverged naming conventions that TOC and page tools use for the pinned and unpinned body class:

Page tools: vector-feature-page-tools-pinned-enabled and vector-feature-page-tools-pinned-disabled
TOC: vector-toc-pinned and vector-toc-unpinned

We should make TOC and page tools use the same naming convention for the body class. This might mean making TOC pinning logic also delegate to features.js to handle the toggling of the body class. If the persistence of pinned state is not wanted for TOC (open question, also see T316060), we might consider adding an isPersistent param to the features.js toggle method that TOC can pass as false.

Developer Notes

Note that because vector-toc-pinned and vector-toc-unpinned classes are part of cached HTML, we need to handle this in multiple deploys. For example,

  1. Deploy vector-feature-toc-pinned-enabled/vector-toc-pinned-disabled additions to CSS.
  2. Once 1) is cached, make the changes to the JS and HTML to use the new convention and remove old selectors in CSS

Acceptance Criteria

  • All components that use pinning in Vector (at time of writing, page tools and TOC) use the same naming convention for the body class pinned state

QA steps

  • As a logged in user, collapse the table of contents. Refresh page, and table of contents should remain collapsed.

QA Results - Beta

ACStatusDetails
1T325032#8684296

QA Results - Prod

ACStatusDetails
1T325032#8712271

Event Timeline

nray renamed this task from Make TOC pinning body class use `vector-feature-toc-pinned-enabled`/`vector-feature-toc-pinned-disabled` convention to Make TOC pinned body class use `vector-feature-toc-pinned-enabled`/`vector-feature-toc-pinned-disabled` convention.Dec 13 2022, 12:43 AM

Change 867299 had a related patch set uploaded (by Nray; author: Nray):

[mediawiki/skins/Vector@master] Add toc vector-feature-toc-pinned-enabled and vector-feature-toc-pinned-disabled classes

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

Change 867299 abandoned by Nray:

[mediawiki/skins/Vector@master] Add toc vector-feature-toc-pinned-enabled and vector-feature-toc-pinned-disabled classes

Reason:

Feel free to reopen when this is a prioritized

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

ovasileva triaged this task as Medium priority.Feb 14 2023, 5:56 PM
ovasileva lowered the priority of this task from Medium to Low.
ovasileva set the point value for this task to 5.

Change 889896 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/Vector@master] [WIP] Update naming convention for TOC

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

vector-feature-toc-pinned-enabled/vector-feature-toc-pinned-disabled is a bit confusing vector-feature-toc-pinned/vector-feature-toc-unpinned might be less so even if it means changing other pinnable elements classes

Also these changes will be affected in https://phabricator.wikimedia.org/T324505 and it's patch https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/889520 as vector-toc-pinned/vector-toc-unpinned classes are used there

Change 889896 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update naming convention for TOC

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

Change 891652 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/Vector@master] [WIP] Removes the TOC class in body and adds in html

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

Change 891652 merged by jenkins-bot:

[mediawiki/skins/Vector@master] [WIP] Removes the TOC class in body and adds in html

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

Change 894119 had a related patch set uploaded (by Kimberly Sarabia; author: Kimberly Sarabia):

[mediawiki/skins/Vector@master] Removes old style rule

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

@bwang and Kim will pair on this one today.

bwang removed bwang as the assignee of this task.Mar 10 2023, 6:53 PM

Change 894119 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Removes old style rule

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

Edtadros subscribed.

Test Result - Beta

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

Test Artifact(s):

QA Steps

✅ AC1: As a logged in user, collapse the table of contents. Refresh page, and table of contents should remain collapsed.

Screen Recording 2023-03-10 at 1.51.31 PM.mov.gif (860×1 px, 1 MB)

Edtadros removed ovasileva as the assignee of this task.
Edtadros added a subscriber: ovasileva.

Test Result - Prod

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

Test Artifact(s):

QA Steps

✅ AC1: As a logged in user, collapse the table of contents. Refresh page, and table of contents should remain collapsed.

Screen Recording 2023-03-20 at 4.06.41 PM.mov.gif (930×1 px, 1 MB)