Page MenuHomePhabricator

Wikidata typeahead customization is not compatible with Minerva
Closed, ResolvedPublicBUG REPORT

Description

NOTE: This currently only impacts beta cluster, but on June 26th will impact production so please address this before then. We are turning off MobileFrontend's search overlay in favor of the code used by Vector 2022 as part of T395634: Remove MobileFrontend and Minerva search code post-deployment of new mobile typeahead search. Given Wikidata replaces the default search experience of Vector it needs to do the same in Minerva. Please see options below.

Steps to replicate the issue (include links if applicable):

What happens?:

No search results - TypeaheadSearch is using the default API endpoint which is not Wikidata compatible.

What should have happened instead?:
Search results should show.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

  • Possible solutions **

Option 1: Use the hook we provided

You will need to use SkinPageReadyConfig to define a new module for Wikibase.

That module depending on time allowance can do one of several things

  1. force show search and use the legacy typeahead from Vector.
$('.minerva-header .search-box').show()
  1. As part of your updates to the new typeahead search component for Vector (T321543: [EPIC] Making other entity types more accessible through the search box), revise your new component override that applies to Vector to also apply to Minerva, copying across the relevant bits from the core TypeaheadSearch relating to Dialog.

Option 2: Force show search input

You can force display the search as a temporary solution at the cost of a small search area. This will allow it to use the new typeahead search, legacy Vector search or some other experience without worrying about implementing the dialog version of the component.

.minerva-header .search-box {     display: flex !important;
    flex-shrink: 1;}
#searchIcon { display: none !important; }}')

Option 3: Switch to Vector 2022 responsive skin

There may be benefits to doing { T343052}. When I raised this ticket this is one of the scenarios I imagined happening.

Event Timeline

Jdlrobson-WMF updated the task description. (Show Details)

Hey @AudreyPenven_WMDE as discussed previously the Minerva skin is now using the Typeahead search component from the desktop skin.
I am around for the next 11 days before taking an extended leave so it's essential if you need help from me with this migration or have any questions you let me know ASAP.

Thanks in advance!

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

[mediawiki/extensions/Wikibase@master] Apply new CodexTypeahead to Minerva

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

@Jdlrobson-WMF
Although it would be good to have parity across all the skins for the typeahead search we have only optimised it for Vector 2022 and will leave it at that for now before deciding in the future if we will implement it to other skins

And would ideally keep the rest of the skins search bars as is.

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

[mediawiki/skins/MinervaNeue@master] It is possible to pass in a custom URL generator

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

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

[mediawiki/core@master] Skin: Search module init function called on load

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

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

[mediawiki/extensions/Wikibase@master] Minerva should use Wikibase search client

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

Change #1152285 merged by jenkins-bot:

[mediawiki/core@master] Skin: Search module init function called on load

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

Change #1152282 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] It is possible to pass in a custom URL generator and API client

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

And would ideally keep the rest of the skins search bars as is.

Hi @Arian_Bozorg I think there may have been a misunderstanding when we spoke through the Typeahead project. Keeping "as is" is not really an option since you are intentionally replacing the default TypeaheadSearch on Vector and do not benefit from the upstream changes.

Although it would be good to have parity across all the skins for the typeahead search we have only optimised it for Vector 2022 and will leave it at that for now before deciding in the future if we will implement it to other skins

Given this I would advise one of two options

  1. Do nothing - this will result in the search icon on Minerva taking the user to Special:Search with no JavaScript autocomplete. This is not ideal but perhaps preferable depending on your plans for mobile.
  2. Merge the small patch I've proposed at https://gerrit.wikimedia.org/r/1152287 - this will make the core TypeaheadSearch use the Wikidata API. You can safely land this any time before June 26th, but obviously the sooner the better for testing.

We can talk on Tuesday about what you prefer and I'd like us to document your choice in this ticket before I leave on June 11th as otherwise my team will assume option 1.

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

[mediawiki/skins/Vector@master] Deprecate use of mw.config in Vector Typeahead

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

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

[mediawiki/extensions/Wikibase@master] Load wikibase.typeahead.search on both Minerva and Vector 2022

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

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

Change #1153376 abandoned by Jdlrobson:

[mediawiki/extensions/Wikibase@master] Load wikibase.typeahead.search on both Minerva and Vector 2022

Reason:

Folded into https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1152287

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

Change #1153373 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Deprecate use of mw.config in Vector Typeahead

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

Change #1152183 abandoned by Jdlrobson:

[mediawiki/extensions/Wikibase@master] POC: Apply new CodexTypeahead to Minerva

Reason:

On short term we'll do https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Wikibase/+/1152287?usp=search but you might be interested this in future.

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

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

Change #1152287 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Load wikibase.typeahead.search on both Minerva and Vector 2022

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

Jdlrobson-WMF claimed this task.

I can confirm this is working great on https://m.wikidata.beta.wmflabs.org/
Thanks for prioritizing!