Page MenuHomePhabricator

[Search] Remove Search Suggestions from Main Pages
Closed, ResolvedPublic2 Estimated Story Points

Description

Background

Currently, on https://en.wikipedia.org/wiki/Main_Page as both a logged in and logged out user, clicking on the search bar shows 3 suggested articles. This is confusing because users have no context or understanding of why these are suggested.

Screenshot 2025-09-24 at 12.32.58 PM.png (1×2 px, 1 MB)

User story

As a logged in or logged out user, clicking on the search bar on Main Page should not list search suggestions

Requirements

  • Focusing on search bar in Main Page should not trigger any dropdowns
  • The fix should apply to all skins and live in resources/src/mediawiki.skinning.typeaheadSearch/restSearchClient.js (MediaWiki core)
  • Works on mobile and desktop site

Acceptance criteria

  • On Main Page, clicking on search bar does not show any suggested articles
  • On an article page, clicking on search bar still shows 3 suggested articles

BDD

Feature: Suppress search suggestions on Main Page

  Scenario: Clicking the search bar on Main Page
    Given I am on the Main Page
    When I click or focus on the search bar
    Then no search suggestions dropdown appears

  Scenario: Clicking the search bar on other pages
    Given I am on an article or non-Main Page
    When I click or focus on the search bar
    Then 3 search suggestions appear as usual

Test Steps

Test Case 1: Verify no search suggestions on Main Page

  1. Navigate to the Main Page as a logged-in user.
  2. Click or focus on the search bar.
  3. AC1: No search suggestions appear.
  4. Log out and repeat the test.
  5. AC2: Still no search suggestions appear for logged-out users.

Test Case 2: Verify normal suggestions on article pages

  1. Navigate to any article page.
  2. Click or focus on the search bar.
  3. AC3: The dropdown with 3 suggested articles appears normally.

QA Results - Beta

ACStatusDetails
1T405515#11365014
2T405515#11365014
3T405515#11365014

Communication criteria

After rollout, we can communicate to village pump to thank them for raising the issue

Rollback plan

Describe the rollback plan in production for this task if something goes wrong.

Event Timeline

HFan-WMF triaged this task as Medium priority.Sep 24 2025, 7:45 PM
HFan-WMF moved this task from Incoming to Needs refinement on the Reader Experience Team board.

@Jdlrobson-WMF we talked about this a bit yesterday, but should the fix live in resources/src/mediawiki.skinning.typeaheadSearch/restSearchClient.js as you indicated in the ticket, or in resources/skins.vector.search/skins.vector.search.js and resources/skins.minerva.search/searchTypeahead.js, which is where the current namespacing logic exists on desktop/where the recommendationApiUrl is being handled?

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

[mediawiki/skins/Vector@master] Centralize recommendation code in core.

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

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

[mediawiki/core@master] Add limitations for recommendation API for main page and namespaces

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

should the fix live in resources/src/mediawiki.skinning.typeaheadSearch/restSearchClient.js

Yes. It should live in resources/src/mediawiki.skinning.typeaheadSearch/restSearchClient.js.

We built for desktop first and forgot to port this change over to mobile, but the idea was to centralize all code and make these experiences consistent. The fact mobile doesn't work the same as desktop is already a bug, so let's address that in the process.

I've written some patches (untested) to demonstrate how this should work.

aude raised the priority of this task from Medium to High.Oct 1 2025, 5:29 PM
aude set the point value for this task to 2.
aude moved this task from Needs refinement to Ready for sprint on the Reader Experience Team board.
Jdrewniak lowered the priority of this task from High to Medium.Mon, Nov 10, 6:35 PM

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

Change #1191713 merged by jenkins-bot:

[mediawiki/core@master] Add limitations for recommendation API for main page and namespaces

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

Change #1191709 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Centralize recommendation code in core.

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

Edtadros subscribed.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Tahoe 26.x
Browser: Chrome Canary (latest as of test date)
Device: MS
Emulated Device: NA

Test Case 1: Verify no search suggestions on Main Page

  1. Navigate to the Main Page as a logged-in user.
  2. Click or focus on the search bar.
  3. AC1: No search suggestions appear.

screenshot 19.mov.gif (872×1 px, 447 KB)

  1. Log out and repeat the test.
  2. AC2: Still no search suggestions appear for logged-out users.

screenshot 20.mov.gif (872×1 px, 377 KB)

Test Case 2: Verify normal suggestions on article pages

  1. Navigate to any article page.
  2. Click or focus on the search bar.
  3. AC3: The dropdown with 3 suggested articles appears normally.

screenshot 22.mov.gif (872×1 px, 470 KB)

screenshot 21.mov.gif (872×1 px, 542 KB)

HFan-WMF claimed this task.