Page MenuHomePhabricator

Vector 2022 should use details element instead of checkbox hack (IE11) for better accessibility and to fix issues with hover states on language button
Open, LowPublic

Description

Background

The checkbox hack is used in places where an interactive dropdown is needed but we don't want to require JavaScript, notably for header navigation tools in Vector and MinervaNeue and the language button in Vector 2022. Here's an example from Vector:

Screenshot 2023-03-28 at 3.01.18 PM.png (792×1 px, 306 KB)

This is not fully compatible with Codex, and is most noticeable when you long press the language button resulting in accessible text.

The details element provides a more modern alternative: https://caniuse.com/?search=details

In short, at the moment accessibility of the site is coming at the cost of support for a small amount of users using outdated browsers.

User story

As a user of a modern browser (and majority of Wikimedia's audience) I want the best accessibility for all the ways I interact with the site.

Requirements

  • The details element should be used instead of the checkbox hack
  • Vector should not use checkbox hack

Per our commitment to grade C browsers, it is important that the user can login and view an article. With this in mind:

  • For IE11 and browsers that do not support the details element the table of contents should not be available (hidden)
  • For IE11 and browsers that do not support the details element, the page tools menu will not be available (hidden)

Design

If details/summary is used without consideration of IE11 this would be the outcome for IE11:

Screenshot 2024-04-25 at 4.52.52 PM.png (639×1 px, 365 KB)

To avoid this we should hide these menus given the requirements like so:

Screenshot 2024-04-25 at 5.02.11 PM.png (1×3 px, 1 MB)

Historic information

This information is provided for context, but should not be considered while implementing the ticket.

The <label> element is styled to look like a button, and styles based on states like hover, focus, and active are achieved by using a selector based on the sibling <input> element's state. See these styles in the medawiki.ui button.

Currently, there is no way to effectively apply Codex button styles to a label in this way.

Implementation ideas
  • As a first step, we could add selectors like the ones from mediawiki.ui linked above. This way, the CSS-only Button classes could be added to the <label> element and all necessary styles would apply, including for the different states
  • In the future, we may want to consider a ButtonMenu component whose CSS-only version is the checkbox hack

sign off steps

  • With this change, the code resources/src/mediawiki.page.ready/checkboxHack.js will likely have no consumers and should be deprecated and removed

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

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

[mediawiki/skins/Vector@master] POC: Express dropdowns as details/summary elements

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

It's a good question. It looks like this would be straightforward so it would be a product call - these menus are important and we'd need to think carefully about how they degrade in older browsers (it might be better to make them disappear rather than to make them always show for example).

Support looks pretty good based on who we tend to build for: https://caniuse.com/?search=details

CCiufo-WMF changed the task status from Open to Stalled.Mar 7 2024, 8:40 PM

This is stalled pending dropping IE 11 from Basic Support

Test wiki created on Patch demo by Jdlrobson using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/a50d75d75f/w

Jdlrobson renamed this task from Button: Consider supporting the "checkbox hack" to Vector 2022 should drop support for checkbox hack (IE11) for better accessibility.Apr 26 2024, 12:02 AM
Jdlrobson updated the task description. (Show Details)
CCiufo-WMF changed the task status from Stalled to Open.May 24 2024, 2:50 PM

On wikitech-l we just announced the dropping of dedicated support for IE11 (https://lists.wikimedia.org/hyperkitty/list/wikitech-l@lists.wikimedia.org/thread/B52WYXP7JBCVYOS7WRNSJNSOHUZYOAJH/). Is this still stalled?

Even though there are a few more things to finish off in T288287: Remove IE11 from Basic support ("Grade C"), I'd say this is effectively unblocked.

Jdlrobson moved this task from Incoming to Groomed on the Web-Team-Backlog-Archived board.

This is mostly ready to go, but we will need to think carefully about whether we care about the broken experience for older browsers before we work on this, and how the experience should degrade. Currently it degrades to:

Screenshot 2024-04-25 at 4.52.52 PM.png (639×1 px, 365 KB)

Possible options are:

  • This is acceptable
  • Show a banner asking the user to upgrade their browser.
  • Hide menus

This is mostly ready to go, but we will need to think carefully about whether we care about the broken experience for older browsers before we work on this, and how the experience should degrade. Currently it degrades to:

Screenshot 2024-04-25 at 4.52.52 PM.png (639×1 px, 365 KB)

Possible options are:

  • This is acceptable
  • Show a banner asking the user to upgrade their browser.
  • Hide menus

@Jdlrobson Can you enable permissions on

Screenshot 2024-04-25 at 4.52.52 PM.png (639×1 px, 365 KB)
? I can't see the screenshot to determine whether or not the old browser experience is too broken.

Done!

Thanks.

Per @AnneT 's initial recommendation, let's have this degrade by hiding the menus. That is much cleaner and more usable.

Screenshot 2024-04-25 at 5.02.11 PM.png (1×3 px, 1 MB)

Depending on the likelihood of IE11 readers are looking for things that are hidden, we may also want to include a notice to the effect of...

Some features may not work as expected because you are using a browser that is no longer supported. Please use a supported browser.

We can add the notice as a follow-up ticket if that usecase arises.

Thanks this looks ready for estimation now! Perhaps as part of sprint 6?

Jdlrobson lowered the priority of this task from High to Medium.Jun 13 2024, 1:22 AM
Jdlrobson renamed this task from Vector 2022 should drop support for checkbox hack (IE11) for better accessibility to Vector 2022 should drop support for checkbox hack (IE11) for better accessibility and to fix issues with hover states on language button.Jun 20 2024, 5:44 PM
Jdlrobson added a subscriber: Diskdance.
NOTE: At time of writing, I seem to be running into https://issues.chromium.org/issues/41152783 when testing the patch for this fix which is a little worrying in Chrome. * Click hide on table of contents * Click tables of contents icon. See: awww snap
NOTE: At time of writing, I seem to be running into https://issues.chromium.org/issues/41152783 when testing the patch for this fix which is a little worrying in Chrome. * Click hide on table of contents * Click tables of contents icon. See: awww snap

I can reproduce the same Chromium issue with the crash on the Citizen skin, which has already replaced most of the checkbox hacks with <details> and <summary>. I am not sure if it is directly caused by the said issue, but it does trigger occasionally.

This will be a complex change and given the bug above we need more time to think about it. Postponing to post-dark mode deploy.

Change #997594 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] Express dropdowns as details/summary elements

Reason:

Not currently prioritized due to the existing chrome bug.

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

Jdlrobson renamed this task from Vector 2022 should drop support for checkbox hack (IE11) for better accessibility and to fix issues with hover states on language button to Vector 2022 should use details element instead of checkbox hack (IE11) for better accessibility and to fix issues with hover states on language button.Sep 12 2024, 10:32 PM
Jdlrobson updated the task description. (Show Details)

@Jdlrobson Preface: The task scope has changed a few times. While I appreciate moving away from the checkbox hack, I'd like to share a small concern about the semantics of proposed details/summary specifically for the language button.
While details/summary seems compromisingly tolerable, it's semantically not the best choice in my opinion. A Codex MenuButton seems much more like a fitting choice for the language button. As it was published not earlier than v1.7.0 and June 2024, it wasn't available at the time of initially writing the task. We should reconsider the task acceptance criteria from my POV.

Jdlrobson changed the task status from Open to Stalled.Sep 13 2024, 5:05 PM

Hi, @Volker_E the main issue here is that the checkbox hack is not compatible with Codex buttons so hover states are broken. This component also needs to work with JavaScript disabled. When we talked to DST before they recommended using details/summary.

Since then we've discovered there are serious browser bugs in Chrome which cause the browser to crash when the details element is used (T333394#9912251)

Perhaps this can be added to a future DST/Web sync.

Given your comment and the upstream bug, I don't think it's ready to work on yet so I'm marking as stalled.

Jdlrobson-WMF lowered the priority of this task from Medium to Low.Aug 27 2025, 4:21 PM

Change #997594 restored by Jdlrobson:

[mediawiki/skins/Vector@master] Express dropdowns as details/summary elements

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

FWIW, I am not seeing the issues with browser crashes any more, so it might be worth reconsidering this next quarter.

HFan-WMF subscribed.

@Jdlrobson does that mean we can likely close this out?

@Jdlrobson does that mean we can likely close this out?

Sorry for confusion. The browser crashes related to the solution proposed here, not an existing issue.

@bwang has been advocating for this change for accessibility reasons if I recall correctly.

Jdlrobson-WMF changed the task status from Stalled to Open.Mon, Jan 12, 5:38 PM