Search gets stuck in a "No results found" loop when a new user sorts by "Last read"

AI-generated summary

A bug report details how selecting Sort by → Last read on the /search page can permanently lock new users into a “No results found” state. Because the sort preference is saved in local storage, it applies to all future searches. However, since the Last read filter only returns previously visited topics, a brand-new user with no reading history sees zero results. The interface bug is that the Sort by dropdown disappears when no results are found, leaving the user unable to change the sort order manually, even by using search operators like order:latest. The issue persists until the user clears their browser’s local storage. The report requests that the sort dropdown remain visible during empty states and suggests a fallback or warning message when a user with empty history attempts to sort by Last read.

Summary

An issue was reported where selecting Sort by → Last read on /search page saves that preference in browser local storage and automatically applies it to all subsequent full-page searches.

Because Last read only returns topics the user has previously visited, a brand-new user with no reading history gets “No results found” for every search. Since the Sort by dropdown is hidden when there are zero results, the user has no way to switch back and manually typing a sort operator like order:latest into the search bar does not override it.

Steps to reproduce

  1. Log in as a brand-new user who has not opened or read any topics.

  2. Navigate to /search?q=welcome (or any search term with matches). Results load along with the Sort by dropdown.

  3. Change Sort by to Last read.

  4. The page updates to “No results found” and the Sort by dropdown disappears.

  5. Perform another search, or navigate away and return to /search?q=welcome. It continues to show no results and no sort dropdown.

Expected behavior

  • The Sort by dropdown should remain accessible even when a search returns zero results so the user can change the sort order.

  • Ideally, sorting by Last read with empty read history should either display a helpful message or fall back to a default sort order rather than locking the user into an empty state.

Actual behavior The user is permanently stuck with “No results found” on all full-page searches until they manually clear their browser’s local storage.