From 01b36db348464678e3608cf7ea30326198b045b0 Mon Sep 17 00:00:00 2001 From: Philipinho <16838612+Philipinho@users.noreply.github.com> Date: Tue, 25 Aug 2026 00:02:43 +0100 Subject: [PATCH] fix: stop empty-state flicker while the search query debounces --- .../client/src/features/search/components/search-spotlight.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/client/src/features/search/components/search-spotlight.tsx b/apps/client/src/features/search/components/search-spotlight.tsx index 569c85b20..8b41fa870 100644 --- a/apps/client/src/features/search/components/search-spotlight.tsx +++ b/apps/client/src/features/search/components/search-spotlight.tsx @@ -107,6 +107,8 @@ export function SearchSpotlight({ spaceId }: SearchSpotlightProps) { }, [aiSearchError, t]); const isLabelBrowse = (filters.labelIds?.length ?? 0) > 0; + // while the debounce is pending the empty list is not a settled "no results" + const isQuerySettled = query === debouncedSearchQuery; // Determine result type for rendering const isAttachmentSearch = @@ -235,6 +237,7 @@ export function SearchSpotlight({ spaceId }: SearchSpotlightProps) { {(query.length > 0 || isLabelBrowse) && !isFetching && + isQuerySettled && resultItems.length === 0 && ( {t("No results found...")} )}