From 0cf7bb2d0ed4ee46a1fec6e2f1533789c6c2e087 Mon Sep 17 00:00:00 2001 From: Dustin Healy <54083382+dustinhealy@users.noreply.github.com> Date: Thu, 22 Jan 2026 16:36:46 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8A=20fix:=20Conversation=20Search=20R?= =?UTF-8?q?esult=20Announcement=20(#11449)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: search result announcements * chore: address Copilot comments * chore: no nested ternary statements allowed * chore: memoize results announcement --- client/src/routes/Search.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/src/routes/Search.tsx b/client/src/routes/Search.tsx index a9f210832c..b4db28c651 100644 --- a/client/src/routes/Search.tsx +++ b/client/src/routes/Search.tsx @@ -64,6 +64,17 @@ export default function Search() { } }, [isError, searchQuery, showToast]); + const resultsCount = messages?.length ?? 0; + const resultsAnnouncement = useMemo(() => { + if (resultsCount === 0) { + return localize('com_ui_nothing_found'); + } + if (resultsCount === 1) { + return localize('com_ui_result_found', { count: resultsCount }); + } + return localize('com_ui_results_found', { count: resultsCount }); + }, [resultsCount, localize]); + const isSearchLoading = search.isTyping || isLoading || isFetchingNextPage; if (isSearchLoading) { @@ -80,6 +91,9 @@ export default function Search() { return ( +
+ {resultsAnnouncement} +
{(messages && messages.length === 0) || messages == null ? (