Page MenuHomePhabricator

Support search filters in no-JS search results page
Closed, ResolvedPublic

Description

This task is a prerequisite for storing search filters in URL params (T261537), because having filter params implies that they will be recognized immediately if the user was to copy and paste the URL into a new browser or otherwise do a hard refresh. Initial results are fetched on the server and we have no guarantee that users will have JS enabled at all, so search filter URLs must be handled in PHP as well as JS.

Acceptance Criteria

  • Users who arrive at Special:MediaSearch with valid filter params in the url (like ?q=tree&mimeType=tiff, etc) must get filtered results back from the initial batch of hits, prior to JS initialization
  • The no-JS UI must provide a way for the user to clear filters that have been set via URL param

Event Timeline

Change 635644 had a related patch set uploaded (by Eric Gardner; owner: Eric Gardner):
[mediawiki/extensions/WikibaseMediaInfo@master] [WIP] Support search filters as URL params in PHP

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

Change 635644 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] Support search filters as URL params in PHP and JS

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

Etonkovidova added subscribers: mwilliams, Etonkovidova.

Moving to @mwilliams for Design review
(1) URL parameters work fine - JS-users and no-JS users with links like this -
https://commons.wikimedia.beta.wmflabs.org/wiki/Special:MediaSearch?q=tree&mimeType=jpeg - will see the filtered results

(2)

The no-JS UI must provide a way for the user to clear filters that have been set via URL param

For example, for the above url - https://commons.wikimedia.beta.wmflabs.org/wiki/Special:MediaSearch?q=tree&mimeType=jpeg - the search results will be displayed as following:

Screen Shot 2021-01-08 at 6.24.23 PM.png (430×880 px, 414 KB)

It looks quite sensible. A user can manually delete the search item and perform a new search, but to delete/modify a file type - that currently can be done only in the url. Is it enough in terms of the UI support for no-JS users?

If all look ok to you - please move the task to Verify in production. I'll do more testing on cross-browser support.