== Background
- per the [[ https://docs.google.com/document/d/1zWK9sUBYJ5moplDJn4sIIHrs8dcEhxYalX4-c26EwCw/edit?tab=t.67ob22zg3p60 | 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
- ~~Go thru a11y checklist here: ~~https://docs.google.com/document/d/1zWK9sUBYJ5moplDJn4sIIHrs8dcEhxYalX4-c26EwCw/edit?tab=t.67ob22zg3p60
- a "search" landmark is present when testing with a screen reader https://www.w3schools.com/accessibility/accessibility_landmarks.php
- ~~when search results are selected (via keyboard), they are scrolled into view~~
== Communication criteria - does this need an announcement or discussion?
- Add communication criteria
https://phabricator.wikimedia.org/T395689#10927006
== QA Results - Beta
| **AC** | **Status** | **Details** |
| ----- | ----- | ----- |
| 1 | ✅ | T395689#10927006 |
| 2 | ✅ | T395689#10927006 |
| 3 | ✅ | T395689#10927006 |