Page MenuHomePhabricator

Implement Empty search recommendations for Vector
Closed, ResolvedPublic3 Estimated Story Points

Description

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

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

wgSearchType
https://gerrit.wikimedia.org/g/operations/mediawiki-config/+/89964f271ad05e13a2a44916685ac0b35c062348/wmf-config/InitialiseSettings.php#12206

Design

  • image.png (1,440×1,011 px, 432 KB)

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

  1. Confirm that the empty search recommendation config is not enabled (check backend or assume by default).
  2. Navigate to any main namespace article (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Dog).
  3. Focus the Vector search input without typing.
  4. AC1: Confirm no recommendations are shown.

Test Case 2: Recommendations not shown outside main namespace

  1. Ensure the config for empty search recommendations is enabled.
  2. Visit a non-mainspace page (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Special:RecentChanges).
  3. Focus the Vector search input.
  4. AC2: Confirm no recommendations are shown.

Test Case 3: Recommendations shown for empty search in main namespace

  1. Ensure the config for empty search recommendations is enabled.
  2. Visit a main namespace article (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Spain).
  3. Focus the Vector search input without typing.
  4. AC3: Confirm a list of article recommendations appears.
  5. AC4: Confirm the recommendation list complies with accessibility standards:

QA Results - Prod

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
bwang renamed this task from Implement Empty search recommendations in Vector to Implement Empty search recommendations in core search.Apr 24 2025, 6:47 PM
bwang updated the task description. (Show Details)
bwang renamed this task from Implement Empty search recommendations in core search to Implement Empty search recommendations UI in core search.Apr 30 2025, 5:58 PM
bwang updated the task description. (Show Details)
bwang renamed this task from Implement Empty search recommendations UI in core search to Implement Empty search recommendations UI in core TAHS.May 9 2025, 5:34 PM
bwang renamed this task from Implement Empty search recommendations UI in core TAHS to Implement Empty search recommendations for Vector.
bwang updated the task description. (Show Details)
bwang added a subscriber: Jdlrobson-WMF.

Bernard to start a refinement thread and update this ticket in ready for next sprint.

Moving this into the current sprint, because it was merged with https://phabricator.wikimedia.org/T393043

bwang set the point value for this task to 3.May 12 2025, 5:27 PM

Setting the estimation as a 3, which is the same as what we estimated in slack for T393043, which is now rolled into this

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

[mediawiki/core@master] Add new fetchRelatedByTitle() to TAHS rest client

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

Core patch is ready but we need to make some changes in Codex.

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

[design/codex@main] Update TAHS to work with empty search recommendations through new showEmptyQueryResults prop

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

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

Bernard is having issues with Codex locally. Getting an error that not getting locally.

It's close but the local Codex development is preventing progress.
@Jdrewniak would love to hear more about this later.
Will possibly debug in SHDT.

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

[design/codex@main] Update TAHS to work with empty search recommendations through new showEmptyQueryResults prop

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

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

[mediawiki/skins/Vector@master] Update TAHS config for empty search recommendations

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

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

https://patchdemo.wmcloud.org/wikis/551ef43995/w/

Change #1144641 merged by jenkins-bot:

[mediawiki/core@master] Add new fetchRelatedByTitle() to TAHS rest client

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

Change #1146694 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Update TAHS config for empty search recommendations

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

Jdlrobson-WMF lowered the priority of this task from High to Medium.
Jdlrobson-WMF added a subscriber: Edtadros.

Testing this is blocked on a Codex and beta cluster deploy, so QA will be done on test.wikipedia.org as part of verify tasks (Cc @Edtadros in case it makes sense to prep the test steps)

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

[operations/mediawiki-config@master] Enable ReadingList beta feature on test.wikipedia.org

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

Change #1148403 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable ReadingList beta feature on test.wikipedia.org

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

Mentioned in SAL (#wikimedia-operations) [2025-05-20T20:02:43Z] <jforrester@deploy1003> Started scap sync-world: Backport for [[gerrit:1146985|Add zh, en, and meta to zh_arbcom import sources (T394505)]], [[gerrit:1148403|Enable ReadingList beta feature on test.wikipedia.org (T392008)]]

Mentioned in SAL (#wikimedia-operations) [2025-05-20T20:04:54Z] <jforrester@deploy1003> zhaofjx, jdlrobson, jforrester: Backport for [[gerrit:1146985|Add zh, en, and meta to zh_arbcom import sources (T394505)]], [[gerrit:1148403|Enable ReadingList beta feature on test.wikipedia.org (T392008)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Change #1148441 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/mediawiki-config@master] Add the ReadingLists beta feature to the allow list

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

Mentioned in SAL (#wikimedia-operations) [2025-05-20T20:15:26Z] <jforrester@deploy1003> Finished scap sync-world: Backport for [[gerrit:1146985|Add zh, en, and meta to zh_arbcom import sources (T394505)]], [[gerrit:1148403|Enable ReadingList beta feature on test.wikipedia.org (T392008)]] (duration: 12m 43s)

Change #1148441 merged by jenkins-bot:

[operations/mediawiki-config@master] Add the ReadingLists beta feature to the allow list

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

Mentioned in SAL (#wikimedia-operations) [2025-05-20T20:24:14Z] <jforrester@deploy1003> Started scap sync-world: Backport for [[gerrit:1148441|Add the ReadingLists beta feature to the allow list (T392008)]], [[gerrit:rECIT11484091bb57|Enable empty search recommendations on beta cluster and testwiki]]

Mentioned in SAL (#wikimedia-operations) [2025-05-20T20:26:25Z] <jforrester@deploy1003> jforrester, bwang: Backport for [[gerrit:1148441|Add the ReadingLists beta feature to the allow list (T392008)]], [[gerrit:rECIT11484091bb57|Enable empty search recommendations on beta cluster and testwiki]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2025-05-20T20:37:27Z] <jforrester@deploy1003> Finished scap sync-world: Backport for [[gerrit:1148441|Add the ReadingLists beta feature to the allow list (T392008)]], [[gerrit:rECIT11484091bb57|Enable empty search recommendations on beta cluster and testwiki]] (duration: 13m 12s)

Edtadros updated the task description. (Show Details)

I've added the test steps, will verify the steps and test in prod after the deploy.

Jdlrobson-WMF claimed this task.

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

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

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

https://patchdemo.wmcloud.org/wikis/19abcf333d/w/

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

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

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

Test Result - Prod

Status: ❌ FAIL
Environment: enwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Steps

Test Case 1: No recommendations if config is disabled

  1. Confirm that the empty search recommendation config is not enabled (check backend or assume by default).
  2. Navigate to any main namespace article (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Dog).
  3. Focus the Vector search input without typing.
  4. ⬜ AC1: Confirm no recommendations are shown.

My assumption is that the feature flag is enabled so skipping this test.

Test Case 2: Recommendations not shown outside main namespace

  1. Ensure the config for empty search recommendations is enabled.
  2. Visit a non-mainspace page (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Special:RecentChanges).
  3. Focus the Vector search input.
  4. ✅ AC2: Confirm no recommendations are shown.

No search recommendations appear on special pages

screenshot 374.png (692×847 px, 159 KB)

Test Case 3: Recommendations shown for empty search in main namespace

  1. Ensure the config for empty search recommendations is enabled.
  2. Visit a main namespace article (e.g., https://en.wikipedia.beta.wmflabs.org/wiki/Spain).
  3. Focus the Vector search input without typing.
  4. ✅ AC3: Confirm a list of article recommendations appears.
  5. ❌ AC4: Confirm the recommendation list complies with accessibility standards:

The voiceover recognizes it correctly and gives me the number of items. Autocompletion is not forced. However I cannot use the keyboard to navigate the empty search suggestions. Only when I enter a character and the list changes can I navigate with the up down arrow keys.

screenshot 107.mov.gif (1,156×846 px, 714 KB)

❌ AC4: Confirm the recommendation list complies with accessibility standards:

Thanks Edward! This will be fixed in T395689: Fix a11y for empty search recommendations in case you want to copy the QA steps over to that ticket?

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

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

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

https://patchdemo.wmcloud.org//wikis/7aa598f12d/w/

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

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

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

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