[go: up one dir, main page]

Page MenuHomePhabricator

[Visual refinements] Bold active section in ToC (Part 2!)
Closed, ResolvedPublic

Description

Following up from to T314670 in addition to the ToC active-section being bold, the active link should also behave in the following way.

  1. If the active section is a child section, and the parent section is expanded, the parent section should be black but not bold.

Screen Shot 2022-08-05 at 11.46.12 AM.png (1×3 px, 2 MB)

  1. If the active section is a child section, but the parent section is collapsed, the parent section should be black and bold.

Screen Shot 2022-08-05 at 11.47.44 AM.png (1×3 px, 2 MB)

Technical notes

Currently the ToC does not differentiate between active links and active sections (which can be defined as menus that contain sub-menus). In order to handle child links differently than top-level links, we might have to introduce the concept of an active section in addition to the active-link state.

An active-section class could then be appended to the active top-level section which would style it black.

Acceptance Criteria

  • Add jest unit test

QA

When a top-level section of the table of contents is active:

  • The section link is bold and black.

when a sub-section of the table of contents is active:

  • and the section is collapsed: the parent (top-level) section link is bold and black.
  • and the section is expanded: the parent (top-level) section link is black, and the active sub-section link is bold and black.

This behaviour should be verified in the following scenarios:

  1. When the ToC is in the sidebar
  2. When the ToC is in the header
  3. When the ToC is in the sticky-header.
  4. When the ToC is pinned to the edge on narrow screens.

https://phabricator.wikimedia.org/T316032#8285267

QA Results - Prod

Event Timeline

ovasileva raised the priority of this task from Medium to High.Aug 30 2022, 5:32 PM
ovasileva lowered the priority of this task from High to Medium.Aug 31 2022, 2:15 PM

Potentially not a blocker for deployment

nray removed the point value for this task.

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

[mediawiki/skins/Vector@master] Style active top level section differently than ordinary active TOC sections

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

bwang removed bwang as the assignee of this task.Sep 20 2022, 9:59 PM
bwang subscribed.

Change 833458 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Style active top level section differently than ordinary active TOC sections

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

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

[mediawiki/skins/Vector@master] Follow-up: remove redundant code in TableOfContents.js

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

Change 833805 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Follow-up: remove redundant code in TableOfContents.js

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

Edtadros subscribed.

Test Result - Prod

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

Test Artifact(s):

QA Steps

✅ AC1. When the ToC is in the sidebar
When a top-level section of the table of contents is active:

  • The section link is bold and black.

Screen Shot 2022-10-04 at 4.10.07 PM.png (377×702 px, 108 KB)

when a sub-section of the table of contents is active:

  • if the section is collapsed: the parent (top-level) section link is bold and black.

Screen Shot 2022-10-04 at 4.11.21 PM.png (394×664 px, 105 KB)

  • if the section is expanded: the parent (top-level) section link is black, and the active sub-section link is bold and black.

Screen Shot 2022-10-04 at 4.11.33 PM.png (478×697 px, 127 KB)

⬜ AC2. When the ToC is in the header
This AC is not really testable even when disabling the sticky-header, because once you scroll to a section, the TOC in the header is no longer visible. I tried with this page without any text between sections and it still wasn't enough.
When a top-level section of the table of contents is active:

  • The section link is bold and black.

when a sub-section of the table of contents is active:

  • if the section is collapsed: the parent (top-level) section link is bold and black.
  • if the section is expanded: the parent (top-level) section link is black, and the active sub-section link is bold and black.

✅ AC3. When the ToC is in the sticky-header.
When a top-level section of the table of contents is active:

  • The section link is bold and black.

Screen Shot 2022-10-04 at 4.12.44 PM.png (371×680 px, 93 KB)

when a sub-section of the table of contents is active:

  • if the section is collapsed: the parent (top-level) section link is bold and black.

Screen Shot 2022-10-04 at 4.12.58 PM.png (586×728 px, 157 KB)

  • if the section is expanded: the parent (top-level) section link is black, and the active sub-section link is bold and black.

Screen Shot 2022-10-04 at 4.13.09 PM.png (426×704 px, 105 KB)

✅ AC4. When the ToC is pinned to the edge on narrow screens.
When a top-level section of the table of contents is active:

  • The section link is bold and black.

Screen Shot 2022-10-04 at 4.26.39 PM.png (370×533 px, 74 KB)

when a sub-section of the table of contents is active:

  • if the section is collapsed: the parent (top-level) section link is bold and black.

Screen Shot 2022-10-04 at 4.27.02 PM.png (312×535 px, 66 KB)

  • if the section is expanded: the parent (top-level) section link is black, and the active sub-section link is bold and black.

Screen Shot 2022-10-04 at 4.27.14 PM.png (361×538 px, 78 KB)