Page MenuHomePhabricator

Fix a11y for empty search recommendations
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

  • per the a11y spec for empty search recommendations, the down and arrow keys should allow the user to navigate the listbox. There are other keyboard functionality that Codex TAHS provides that isnt working right now.

In addition to that, we want the active selected search recommendation to be scrolled into view. Both of these changes are likely going to be made in Codex

User story

  • As a user of assistive tech, I want to be able to navigate and use the empty search recommendations as normal

Requirements

  • Keyboard functionality works according to the a11y spec
  • Selected search results are scrolled into view When a keyboard event changes the active option in the listbox, use JavaScript to scroll the option referenced by aria-activedescendant into view. Managing aria-activedescendant visibility is essential to accessibility for people who use a browser's zoom feature to increase the size of content.
  • a "search" landmark is added to minerva

BDD

Feature: Accessibility compliance for empty search recommendations

Scenario: Keyboard navigation
  Given I am using the Minerva skin on a beta wiki with Codex TypeaheadSearch enabled
  When I use arrow keys to navigate the empty search recommendations
  Then focus moves between options correctly
  And the selected item is scrolled into view

Scenario: Search landmark for screen readers
  Given I am using a screen reader
  When I navigate the page
  Then a "search" landmark is announced for the search interface

Test Steps

Test Case 1: Keyboard navigation and scroll behavior

  1. On a beta wiki using Minerva skin with Codex TAHS enabled, type a query that returns no search results.
  2. Use the arrow keys to navigate through the empty search recommendation list.
  3. AC1: Focus correctly moves between list items per a11y spec.
  4. AC2: Each selected item is scrolled into view as focus changes.

Test Case 2: Screen reader detects search landmark

  1. Enable a screen reader (e.g., VoiceOver or TalkBack).
  2. Navigate to the search input using rotor or screen reader navigation.
  3. AC3: A "search" landmark is announced.

Design

  • none

Acceptance criteria

Communication criteria - does this need an announcement or discussion?

  • Add communication criteria

https://phabricator.wikimedia.org/T395689#10927006

QA Results - Beta

ACStatusDetails
1T395689#10927006
2T395689#10927006
3T395689#10927006

QA Results - Prod

ACStatusDetails
1T395689#10942860
2T395689#10942860
3T395689#10942860

Event Timeline

Jdlrobson changed the task status from Open to In Progress.May 30 2025, 9:25 PM
Jdlrobson-WMF set the point value for this task to 3.Jun 2 2025, 5:45 PM
Jdlrobson-WMF moved this task from Q4 to Sprint Backlog on the Web-Team board.
Jdlrobson-WMF changed the task status from In Progress to Open.Jun 2 2025, 5:53 PM

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

[design/codex@main] TypeaheadSearch: Ensure keyboard navigation works for empty search results

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

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

[mediawiki/skins/MinervaNeue@master] Add landmark for minerva search

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

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

[design/codex@main] Adds overflow rule

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

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

[design/codex@main] TypeaheadSearch: Enable floating menu for TAHS

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

Change #1154347 abandoned by Bernard Wang:

[design/codex@main] Adds overflow rule

Reason:

Abandoning this approach in favor of the floating menu approach for now

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

Met with DST about this. Going with floatingMenu composable as opposed to CSS solution to fulfill this requirement

  • Selected search results are scrolled into view When a keyboard event changes the active option in the listbox, use JavaScript to scroll the option referenced by aria-activedescendant into view. Managing aria-activedescendant visibility is essential to accessibility for people who use a browser's zoom feature to increase the size of content.

Other patches still valid.

Change #1154309 merged by jenkins-bot:

[design/codex@main] TypeaheadSearch: Ensure keyboard navigation works for empty search results

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

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

[mediawiki/core@master] Update Codex from v2.0.0 to v2.1.0

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

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/25f905bb47/w/

Change #1154345 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Add landmark for minerva search

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

Change #1155734 merged by jenkins-bot:

[mediawiki/core@master] Update Codex from v2.0.0 to v2.1.0

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

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

[design/codex@main] Address inconsistent UI with TypeError

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

Test wiki created on Patch demo by BWang (WMF) using patch(es) linked to this task:
https://patchdemo.wmcloud.org/wikis/dadda6171e/w/

I discussed with @KSarabia-WMF , the floating menu work is out of scope of this task, the changes we already made in Codex 2.1.0 fixed the keyboard and scrolling behavior. so this task is ready for QA.

KSarabia-WMF added a subscriber: Edtadros.

@Edtadros I think this is the only thing to QA

a "search" landmark is present when testing with a screen reader https://www.w3schools.com/accessibility/accessibility_landmarks.php

@Edtadros @KSarabia-WMF just a clarification, all the requirments can be QAed in beta cluster. Both of the following requirments were fixed in codex, which isnt on all wikis yet i believe

Keyboard functionality works according to the a11y spec
Selected search results are scrolled into view When a keyboard event changes the active option in the listbox, use JavaScript to scroll the option referenced by aria-activedescendant into view. Managing aria-activedescendant visibility is essential to accessibility for people who use a browser's zoom feature to increase the size of content.
``

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Steps

Test Case 1: Keyboard navigation and scroll behavior

  1. On a beta wiki using Minerva skin with Codex TAHS enabled, type a query that returns no search results.
  2. Use the arrow keys to navigate through the empty search recommendation list.
  3. AC1: Focus correctly moves between list items per a11y spec.
  4. AC2: Each selected item is scrolled into view as focus changes.

screenshot 6.mov.gif (444×1 px, 563 KB)

Test Case 2: Screen reader detects search landmark

  1. Enable a screen reader (e.g., VoiceOver or TalkBack).
  2. Navigate to the search input using rotor or screen reader navigation.
  3. AC3: A "search" landmark is announced.

screenshot 7.mov.gif (778×1 px, 1 MB)

Edtadros updated the task description. (Show Details)
bwang changed the status of subtask T397064: Use floatingMenu for TAHS from Resolved to Declined.

Test Result - Prod

Status: ✅ PASS
Environment: cawiki
OS: macOS Sequoia 15.5
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Steps

Test Case 1: Keyboard navigation and scroll behavior

  1. On a beta wiki using Minerva skin with Codex TAHS enabled, type a query that returns no search results.
  2. Use the arrow keys to navigate through the empty search recommendation list.
  3. AC1: Focus correctly moves between list items per a11y spec.
  4. AC2: Each selected item is scrolled into view as focus changes.

screenshot 10.mov.gif (766×1 px, 581 KB)

screenshot 9.mov.gif (766×1 px, 2 MB)

Test Case 2: Screen reader detects search landmark

  1. Enable a screen reader (e.g., VoiceOver or TalkBack).
  2. Navigate to the search input using rotor or screen reader navigation.
  3. AC3: A "search" landmark is announced.

screenshot 11.mov.gif (766×1 px, 612 KB)

screenshot 14.mov.gif (766×1 px, 910 KB)

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

https://patchdemo.wmcloud.org//wikis/dadda6171e/w/

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

https://patchdemo.wmcloud.org//wikis/25f905bb47/w/