Page MenuHomePhabricator

Add CSS class to enable Search Suggestions for type=Search
Closed, ResolvedPublic

Description

The "mw-searchInput" CSS class, when placed on an input element, will enable Search Suggest features for that element. See Code Search for reference and examples.

I've tested this locally and it works like a charm.

merged: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/InputBox/+/620780

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 14 2020, 2:45 PM

I uploaded a patch here

Change 620370 had a related patch set uploaded (by MarkAHershberger; owner: Freephile):
[mediawiki/extensions/InputBox@master] Adding CSS class to hook into SearchSuggest feature.

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

I uploaded a revised patch at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/InputBox/+/620780

(It didn't get automatically attached by gerritbot.)

Change 620780 had a related patch set uploaded (by Aklapper; owner: Freephile):
[mediawiki/extensions/InputBox@master] Adding CSS class to hook into SearchSuggest feature.

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

Change 620370 abandoned by Freephile:
[mediawiki/extensions/InputBox@master] Adding CSS class to hook into SearchSuggest feature.

Reason:
New patch uploaded

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

Based on test failures, it looks like I need to update the unit tests for InputBox.

The failures are caused by code style issues and can be fixed with "composer update && composer fix && git commit --amend && git review".

Thanks Mark @MarkAHershberger, but I already fixed the style issues in the latest commit. There are now assertions in the unit tests that are failing, due to the new class attribute not conforming to the declared / expected output of the parser tags for InputBox.

Ah, sorry. I clicked on the abandoned link instead of the new one.

freephile closed this task as Resolved.Aug 18 2020, 9:58 PM
freephile updated the task description. (Show Details)
stjn added a subscriber: stjn.EditedDec 3 2020, 7:49 PM

Belated comment: this makes zero sense for most of the uses of such search forms, which typically concern searching on a specific subset of pages and not everywhere on a wiki. Search suggestions just come up meaningless in most cases, especially in places like https://en.wiktionary.org/wiki/Wiktionary:All_Thesaurus_pages where the target of search box and search suggestions lead people to different places. This was a bad patch to merge essentially without discussion.

(If it makes sense for individual search forms, there should be an option to specify the class to input for authors instead.)