From 83e945ba57192eb36995e9c0a61cb34e742bd8de Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Mon, 12 Aug 2024 16:04:59 -0700 Subject: [PATCH] add cleaner / consolidate `no docs found` message (#2119) --- .../search/SearchResultsDisplay.tsx | 20 +++++-------------- web/src/components/search/SearchSection.tsx | 2 ++ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/web/src/components/search/SearchResultsDisplay.tsx b/web/src/components/search/SearchResultsDisplay.tsx index b5dea7350ee6..5ba96ba49a57 100644 --- a/web/src/components/search/SearchResultsDisplay.tsx +++ b/web/src/components/search/SearchResultsDisplay.tsx @@ -35,8 +35,10 @@ export const SearchResultsDisplay = ({ isFetching, defaultOverrides, performSweep, + searchState, sweep, }: { + searchState: searchState; disabledAgentic?: boolean; contentEnriched?: boolean; agenticResults?: boolean | null; @@ -92,16 +94,11 @@ export const SearchResultsDisplay = ({ if (isFetching && !answer && !documents) { return null; } - if ( - answer === null && - documents != null && - documents.length == 0 && - !isFetching - ) { + if (documents != null && documents.length == 0 && searchState == "input") { return (
-
- +
+ No documents were found!

@@ -114,7 +111,6 @@ export const SearchResultsDisplay = ({ if ( answer === null && (documents === null || documents.length === 0) && - quotes === null && !isFetching ) { return ( @@ -167,12 +163,6 @@ export const SearchResultsDisplay = ({ <> {popup} - {documents && documents.length == 0 && ( -

- No docs found! Ensure that you have enabled at least one connector -

- )} - {documents && documents.length > 0 && (
diff --git a/web/src/components/search/SearchSection.tsx b/web/src/components/search/SearchSection.tsx index 1bd0cab3fe11..0969228eb0de 100644 --- a/web/src/components/search/SearchSection.tsx +++ b/web/src/components/search/SearchSection.tsx @@ -664,6 +664,7 @@ export const SearchSection = ({
{!(agenticResults && isFetching) || disabledAgentic ? ( {!(agenticResults && isFetching) || disabledAgentic ? (