fix(docs/search): handle search index loading and failure states (#3184)
* fix(docs/search): show loading state and replay query when index isn't ready Previously performSearch rendered "No results found" while the MiniSearch index was still loading, which is misleading on slow networks. Track the last query as pendingQuery and replay it from fetchSearchIndex once the index is ready; render a distinct "Failed to load search index" message on fetch error so the loading message doesn't persist indefinitely. Fixes #3180. * fix(docs/search): close stale-replay race and consolidate status messages Drop pendingQuery synchronously in the input handler when the query falls below the minimum length, so a fetchSearchIndex that resolves within the 300ms debounce window after the user clears the field can no longer replay the cleared query into an empty input. Move the idle, loading, and failed copy into a single renderSearchStatus(kind) helper so the four .search-no-results renderings can only drift in one place.
A
Anurag Pappula committed
eda5379c176eaa253d780ea9bcaef3abab4cb9c3
Parent: d2fee51
Committed by GitHub <noreply@github.com>
on 5/29/2026, 9:00:59 AM