Found when testing https://phabricator.wikimedia.org/T284021#7188659
This bug is about displaying correct search results without showing user selected criteria after returning from a file page.
- On Special:MediaSearch with default active Image tab selected, enter any search criteria - e.g. "Yellow tulips" (with no quotes). The number of search results is 1,034 (https://commons.wikimedia.org/w/index.php?search=yellow+tulips&title=Special:MediaSearch&go=Go&type=image)
- Select some criteria, e.g. in the screenshot below - "All licenses" - No restrictions, "All file types" - jpg, "All image sizes" - Medium (https://commons.wikimedia.org/w/index.php?search=yellow+tulips&title=Special:MediaSearch&go=Go&type=image&haslicense=unrestricted&filemime=jpeg&fileres=500%2C1000) - the number of results is 29.
- Go to Categories and Pages (or any other filter tab). Select any namespace - e.g. Discussion.
- Click on one of the file links and, after viewing a file, click the browser button to return back.
The search criteria selected for Categories and Pages - Discussion namespace is preserved, so the page state is restored.
Go to the Image tab - the results are restored, but the search criteria are not displayed. The url shows no search criteria - https://commons.wikimedia.org/w/index.php?search=Yellow+Tulips&title=Special:MediaSearch&go=Go&type=image.