Background
- Now that the Vector TAHS wireup code is moved to core in T380507 we are ready to implement empty search recommendations
User story
As a user I want a responsive search that works consistently across my devices and has the same features on both desktop and mobile
AS a developer I want to have a single unified search experience so that I can ship new features to both platforms easily without duplicating efforts
Requirements
- Core TAHS should render empty search recommendations using the more like api
- Empty search recommendations in TAHS should follow the a11y requirements here: https://docs.google.com/document/d/1zWK9sUBYJ5moplDJn4sIIHrs8dcEhxYalX4-c26EwCw/edit?usp=sharing
- Empty search recommendations should not be shown unless there is a config that enables it
- Empty search recommendations should only show on the main namespace.
Developer notes
For the API, we can use the existing list search API but with a "morelike:" query to return a list of article recommendations
https://en.wikipedia.org/wiki/Special:ApiSandbox#action=query&format=json&list=search&formatversion=2&srsearch=morelike%3APortland_spy_ring&srnamespace=0&srlimit=1
This should happen based off of a config, because morelike is only defined for CirrusSearch
Design
Acceptance criteria
- Empty search recommendations are available in Vector under a feature flag
Requirement
The Vector skin must support empty search recommendations via the new core TypeaheadSearch (TAHS) component. When the user focuses the search box without entering text, a list of article recommendations (based on the “morelike” API) is shown, provided that:
• A specific config flag enabling empty search recommendations is set.
• The current page is in the main namespace.
• The feature meets the accessibility (a11y) criteria defined in the Search A11y Requirements Doc.
BDD
Feature: Empty search recommendations in Vector via TypeaheadSearch Scenario: Config not enabled Given the config for empty search recommendations is disabled When I focus the search input in Vector Then no empty search recommendations are displayed Scenario: Page not in main namespace Given I am on a page outside the main namespace And the config for empty search recommendations is enabled When I focus the search input Then no empty search recommendations are displayed Scenario: User focuses empty search input in main namespace Given I am on a page in the main namespace And the config for empty search recommendations is enabled When I focus the search input in Vector Then a list of article recommendations appears And the recommendations comply with accessibility requirements
Test Steps
Test Case 1: No recommendations if config is disabled
- Confirm that the empty search recommendation config is not enabled (check backend or assume by default).
- Navigate to any main namespace article (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Dog).
- Focus the Vector search input without typing.
- AC1: Confirm no recommendations are shown.
Test Case 2: Recommendations not shown outside main namespace
- Ensure the config for empty search recommendations is enabled.
- Visit a non-mainspace page (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Special:RecentChanges).
- Focus the Vector search input.
- AC2: Confirm no recommendations are shown.
Test Case 3: Recommendations shown for empty search in main namespace
- Ensure the config for empty search recommendations is enabled.
- Visit a main namespace article (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Spain).
- Focus the Vector search input without typing.
- AC3: Confirm a list of article recommendations appears.
- AC4: Confirm the recommendation list complies with accessibility standards:
QA Results - Prod
| AC | Status | Details |
|---|---|---|
| 1 | ⬜ | T392008#10873358 |
| 2 | ✅ | T392008#10873358 |
| 3 | ✅ | T392008#10873358 |
| 4 | ❌ | T392008#10873358 |


