Page MenuHomePhabricator

[M] [Screenreader & Keyboard UX] Improve accessibility of collapsed TOC in header/floating cases for JS users
Closed, ResolvedPublic1 Estimated Story Points

Description

Background

Currently the collapsed TOC in the header and floating icon cases rely only on CSS. This is because the collapsing behavior on narrow viewports must work for no JS users (T307900).

In order to improve the screenreader experience for the collapsed TOC (T313447 & T314176), we can use JS to move the ToC in the DOM to the header, similar to the approach taken with the sticky header.

AC

  • No visual changes
  • The ToC is immediately accessible from the collapsed ToC button and is next to it in the DOM
  • Collapsed ToC behaves like all the other dropdowns, (i.e. can be opened via Enter or Space)
  • The existing no-js solution is preserved for no-js users below tablet viewports (i.e. the ToC automatically collapses into the page title)

[] When the TOC is collapsed (not into the sticky header) the TOC landmark is in the page header and includes the TOC button and TOC menu

Testing steps

  1. When JS is disabled, The TOC should work as it does in production across all viewports

Each of the following cases should pass the 2nd and 3rd AC above

  1. When JS is enabled, test the TOC when collapsed into the page title above tablet viewports by pressing "hide".
  2. When JS is enabled, test the TOC when collapsed automatically into the page title below tablet viewports.
  3. When JS is enabled, test the TOC when collapsed into the sticky header by pressing "hide" when the sticky header is visible.

QA Results - Beta

QA Results - Prod

Event Timeline

Jdlrobson triaged this task as Medium priority.Sep 20 2022, 5:29 PM
bwang renamed this task from [Screenreader UX] Improve accessibility of collapsed TOC in header/floating cases for JS users to [Screenreader & Keyboard UX] Improve accessibility of collapsed TOC in header/floating cases for JS users .Sep 20 2022, 5:38 PM
LGoto set the point value for this task to 3.Sep 20 2022, 5:38 PM
Jdlrobson renamed this task from [Screenreader & Keyboard UX] Improve accessibility of collapsed TOC in header/floating cases for JS users to [medium] [Screenreader & Keyboard UX] Improve accessibility of collapsed TOC in header/floating cases for JS users .Nov 16 2022, 11:18 PM
Jdlrobson renamed this task from [medium] [Screenreader & Keyboard UX] Improve accessibility of collapsed TOC in header/floating cases for JS users to [M] [Screenreader & Keyboard UX] Improve accessibility of collapsed TOC in header/floating cases for JS users .
Jdlrobson changed the point value for this task from 3 to 1.

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

[mediawiki/skins/Vector@master] POC: Move ToC into page title when JS is enabled

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

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

[mediawiki/skins/Vector@master] POC: Move ToC into page title when JS is enabled

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

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

[mediawiki/skins/Vector@master] Remove old JS and CSS relying on vector-toc-collapsed and vector-toc-not-collapsed, remove page tools feature flag from TOC

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

bwang removed bwang as the assignee of this task.Nov 29 2022, 6:33 PM

Change 859135 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Use PinnableHeader in the TOC all the time

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

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

[mediawiki/skins/Vector@master] Generalize Pinnable functionality to not be limited to dropdowns, make Pinnable templates composable

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

Change 862388 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/skins/Vector@master] Page tools: Hide dropdown when not pinned

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

Change 861488 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Generalize Pinnable functionality to not be limited to dropdowns, make Pinnable templates composable

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

@ovasileva @Jdlrobson Because this patch involves several cached HTML changes, I found its to be extremely difficult to maintain complete backwards compatibility with cached HTML users without introducing a lot of additional complexity and technical debt.

Instead, I chose to handle cached HTML by essentially mirroring the behavior for no-js users. So cached HTML users will have the collapsible ToC feature disabled above the tablet viewport, and below the tablet viewport the ToC will continues to automatically collapse into the page title. All collapsed ToC cases work normally for non cached HTML users and JS users.

Considering this would be temporary (for 5 days after this patch is merged), are you ok with this?

  • When the TOC is collapsed (not into the sticky header) the TOC landmark is in the page header and includes the TOC button and TOC menu

@ovasileva I also wanted to suggest that we break out this AC into a separate followup task. It would be easiest to handle that AC after all the cached HTML implications are resolved roughly on the week of 12/12 (patch). Does that work for you?

@ovasileva @Jdlrobson Because this patch involves several cached HTML changes, I found its to be extremely difficult to maintain complete backwards compatibility with cached HTML users without introducing a lot of additional complexity and technical debt.

Instead, I chose to handle cached HTML by essentially mirroring the behavior for no-js users. So cached HTML users will have the collapsible ToC feature disabled above the tablet viewport, and below the tablet viewport the ToC will continues to automatically collapse into the page title. All collapsed ToC cases work normally for non cached HTML users and JS users.

Considering this would be temporary (for 5 days after this patch is merged), are you ok with this?

Discussed further with @bwang. This seems fine, let's go ahead. Let's make sure we QA once the regular collapsing behavior returns as well.

  • When the TOC is collapsed (not into the sticky header) the TOC landmark is in the page header and includes the TOC button and TOC menu

@ovasileva I also wanted to suggest that we break out this AC into a separate followup task. It would be easiest to handle that AC after all the cached HTML implications are resolved roughly on the week of 12/12 (patch). Does that work for you?

Sounds good

Change 862388 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Page tools: Hide dropdown when not pinned

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

Change 859143 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Use JS to move the ToC into page title to fix a11y issues and simplify styles

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

@bwang Can this be moved to QA? Is there anything more to review here?

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

[mediawiki/skins/Vector@master] Simplify grid styles now that grid is no longer needed to position ToC

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

bwang removed bwang as the assignee of this task.Dec 7 2022, 12:54 AM

@nray Sorry there's this follow up task too, but if its too much I could break it out into a separate task

Change 865185 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Simplify grid styles now that grid is no longer needed to position ToC

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

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

[mediawiki/skins/Vector@master] Clean up code handling cached HTML for 3 patches

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

Change 861454 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Clean up code handling cached HTML for 3 patches

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

Test Result - Beta

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

Test Artifact(s):

QA Steps

Testing steps
✅ AC1: When JS is disabled, The TOC should work as it does in production across all viewports
✅ AC2: When JS is enabled, test the TOC when collapsed into the page title above tablet viewports by pressing "hide".

Screen Recording 2022-12-18 at 2.31.09 PM.mov.gif (818×2 px, 854 KB)

Screen Recording 2022-12-18 at 2.31.33 PM.mov.gif (818×2 px, 1 MB)

✅ AC4: When JS is enabled, test the TOC when collapsed automatically into the page title below tablet viewports.
Screen Recording 2022-12-18 at 2.32.57 PM.mov.gif (938×748 px, 772 KB)

✅ AC5: When JS is enabled, test the TOC when collapsed into the sticky header by pressing "hide" when the sticky header is visible.
Screen Recording 2022-12-18 at 2.33.35 PM.mov.gif (938×1 px, 1 MB)

Edtadros subscribed.

Test Result - Prod

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

Test Artifact(s):

QA Steps

Testing steps
⬜ AC1: When JS is disabled, The TOC should work as it does in production across all viewports
@ovasileva, I looked at this even though it wasn't testable. With JS off, if you click on the TOC button when collapsed, and then click out to un-highlight it, the button overlaps the border of the TOC.

Screenshot 2022-12-18 at 2.23.37 PM.png (321×331 px, 35 KB)

Screen Recording 2022-12-18 at 2.22.46 PM.mov.gif (940×896 px, 2 MB)

✅ AC2: When JS is enabled, test the TOC when collapsed into the page title above tablet viewports by pressing "hide".

Screen Recording 2022-12-18 at 2.41.24 PM.mov.gif (976×1 px, 3 MB)

✅ AC4: When JS is enabled, test the TOC when collapsed automatically into the page title below tablet viewports.
Screen Recording 2022-12-18 at 2.43.09 PM.mov.gif (976×960 px, 1 MB)

✅ AC5: When JS is enabled, test the TOC when collapsed into the sticky header by pressing "hide" when the sticky header is visible.
Screen Recording 2022-12-18 at 2.45.19 PM.mov.gif (584×1 px, 1 MB)

The border overlap is okay! This is good to resolve.