Page MenuHomePhabricator

Implement fix for broken rotor on mobile (headings not read)
Closed, ResolvedPublic5 Estimated Story Points

Description

Background

After several spikes and cross team discussion evaluating multiple solutions to the broken rotor, we have identified the best path forward. We will implement by removing the button role from the .mw-heading div and will make the toggle icon a button. See example before and after markup below.

Current markup:

<section aria-labelledby="Section_title">
  <div
    class="mw-heading"
    role="button"
    tabindex="0"
    aria-controls="section-body"
    aria-expanded="false"
  >
    <span class="mf-icon" aria-hidden="true"></span>
    <h2 id="Section_title">Title</h2>
    <span class="mw-editsection">...</span>
  </div>
  <div id="section-body" hidden="until-found">…section body…</div>
</section>

New markup:

<section aria-labelledby="Section_title">
  <div
    class="mw-heading"
  >
    <h2 id="Section_title">Title</h2>
    <button class="mf-icon" aria-labelledby="Section_title"></button>
    <span class="mw-editsection">...</span>
  </div>
  <div hidden="until-found">…section body…</div>
</section>

For code review be sure to add @KSarabia-WMF from Reader Growth and the ‘ctt-review’ or ‘ctt-attention’ hashtag on gerrit for C. Scott's review.

Note: Markup changes will make DiscussionTools unit tests fail. Reach out to Editing for how to update their tests. This is an automated process.

Requirements

  • button role and other related attributes are removed from the .mw-heading div
  • the collapse button should be hidden with JS disabled
  • the mf-icon is no longer aria-hidden and is converted into a <button>
  • mf-icon button is placed after h2 in the marker but visually placed before via CSS
  • test that duplicate aria-labelledby on <section> and <button> works fine
  • cached HTML is accounted for
  • functionality is tested across iOS and Android and with as many screen readers as possible
  • DiscussionTools tests are updated (not necessary according to Editing)

Acceptance criteria

  • Headings are navigable via rotor on iOS and Android
  • DiscussionTools' markers continue working as expected
  • When navigating through the page, the collapse icon button gets read to assistive technology after the heading
  • Assistive technology users can easily toggle collapsed sections
  • Screen reader should not be overly verbose.
  • The icon loads late, ensure there is no repaint/reflow
  • Collapsed sections load and work well on slow connections

Screen Reader Testing

For maximum confidence, it would be great if we could check the following screen reader / browser combinations on mobile

  • Talkback + Chrome ✅ verified
  • Talkback + Samsung Internet
  • Talkback + Firefox
  • VoiceOver + Safari ✅ (Verified on iPhone Air iOS 26.4.2)
  • VoiceOver + Chrome ✅ (Verified on iPhone Air iOS 26.4.2)
  • VoiceOver + Firefox ✅ (Verified on iPhone Air iOS 26.4.2)

Event Timeline

LMora-WMF updated the task description. (Show Details)
egardner added a subscriber: KSarabia-WMF.
egardner subscribed.

@LMora-WMF thanks for writing up this task! I'd recommend adding a rollback plan to this task (we can discuss as a team what that plan would be) as well as more high-level acceptance criteria (headers are navigable via iOS rotor, collapsible sections are accessible, we didn't break DiscussionTools).

I also think an important part of testing will be validating that the resulting screen reader experience is acceptable, given the risk of increased verbosity since the heading text will get read twice. Can we document that in the task?

LMora-WMF triaged this task as Medium priority.
LMora-WMF set the point value for this task to 5.

Change #1287434 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/extensions/MobileFrontend@master] [parsoid] Fix for broken rotor on mobile

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

Test wiki created on Patch demo by LMora-WMF using patch(es) linked to this task:
https://35455a7ecd.catalyst.wmcloud.org/w/

FYI for VoiceOver + Safari on iOS testing

If the VoiceOver rotor is set to Headings and announces “heading not found,” that does not always mean the page has no headings. It might mean the VoiceOver cursor is currently in a local context that has no headings, such as Safari browser controls, a menu, an overlay, a toolbar, the address bar area, or another container outside the main webpage content.
The rotor acts on the user’s current VoiceOver context.
For example, on EN Wikipedia’s Paris article, headings are present in the page content. If VoiceOver says “heading not found,” first verify that VoiceOver focus is actually inside the article/page body rather than in Safari UI or another local context.
Testing note: before logging “missing headings,” move VoiceOver focus directly into the page content, such as onto the visible article title or main heading, then retry the Headings rotor. If heading navigation works after that, the issue was cursor/context placement, not missing/wrong heading markup.

I just tested the following patchdemo page with Android TalkBack
https://35455a7ecd.catalyst.wmcloud.org/wiki/Headings_test_page

I posted the video below. Seems like it works.
Android TalkBack PatchDemo headings fix.

Notably, I also tested a page on production wikipedia and noticed that navigate-by-heading was broken for me with Android as well.
Android TalkBack production headings broken 👎

Change #1294340 had a related patch set uploaded (by LorenMora; author: LorenMora):

[mediawiki/extensions/DiscussionTools@master] [parsoid] Fix for broken rotor on mobile

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

Change #1294340 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] [parsoid] Fix for broken rotor on mobile

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

Change #1287434 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] [parsoid] Fix for broken rotor on mobile

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

AnneT removed bwang as the assignee of this task.Jun 2 2026, 7:14 PM
AnneT added subscribers: Edtadros, Etonkovidova, bwang.

Hey @Etonkovidova and @Edtadros, I'd strongly recommend testing this in beta this week before it rides the train next week. If that won't be possible, please let me know ASAP so we can put engineering resources on testing in beta. Thanks!

Test wiki on Patch demo by LMora-WMF using patch(es) linked to this task was deleted:

https://35455a7ecd.catalyst.wmcloud.org/w/

HFan-WMF subscribed.

Tracking QA testing in a separate ticket https://phabricator.wikimedia.org/T428689, leaving this ticket in sprint 21 for point value of eng work burndown.