From c2adcff12af507304a1e556c679005292b754c78 Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Tue, 7 Oct 2025 14:41:54 -0600 Subject: [PATCH] best matches --- .../GlobalSearchModalBase.tsx | 10 +++- .../GlobalSearchSecondaryContent.tsx | 53 +++++++++++-------- .../ui/search/SearchModal/SearchModal.tsx | 1 - 3 files changed, 41 insertions(+), 23 deletions(-) diff --git a/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchModalBase.tsx b/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchModalBase.tsx index c9677386f..6b7ab5c01 100644 --- a/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchModalBase.tsx +++ b/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchModalBase.tsx @@ -37,11 +37,19 @@ export const GlobalSearchModalBase = ({ const searchItems: SearchItems[] = useMemo(() => { if (openSecondaryContent) { - return items.map((item) => ({ + const allItems: SearchItem[] = items.map((item) => ({ label: , value: item.assetId, type: 'item', })); + + return [ + { + type: 'group', + label: 'Best matches', + items: allItems, + }, + ]; } const todayAndYesterday = createChatRecord(items, 'updatedAt'); diff --git a/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchSecondaryContent.tsx b/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchSecondaryContent.tsx index 3f8250e26..e6bcd719e 100644 --- a/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchSecondaryContent.tsx +++ b/apps/web/src/components/features/search/GlobalSearchModal/GlobalSearchSecondaryContent.tsx @@ -1,4 +1,5 @@ /** biome-ignore-all lint/complexity/noUselessFragments:it is okay */ +/** biome-ignore-all lint/security/noDangerouslySetInnerHtml: I know what I'm doing mom */ import type { AssetType } from '@buster/server-shared/assets'; import type { SearchTextData } from '@buster/server-shared/search'; import { Link, type LinkProps, useRouter } from '@tanstack/react-router'; @@ -27,7 +28,7 @@ export const GlobalSearchSecondaryContent: React.FC +
{assetType === 'metric_file' ? ( ) : ( @@ -147,23 +148,29 @@ const MetricScreenshotContainer = ({ (!isFetchedMetric || !isFetchedMetricData) && !isErrorMetric && !isErrorMetricData; return ( -
- - - {isLoadingContent ? ( - - ) : ( - - )} - - -
+ + + {isLoadingContent ? ( + + ) : ( + + )} + + ); }; @@ -264,7 +271,11 @@ const Ancestors = React.memo( id: assetId, }) as LinkProps; - return {children}; + return ( + + {children} + + ); }; return ( @@ -278,7 +289,7 @@ const Ancestors = React.memo( )} > {Icon} - {title} + {'•'} {secondaryText}
@@ -316,7 +327,7 @@ const Ancestors = React.memo( const lastItemIndex = allAncestors.length - 1; return ( -
+
{allAncestors.map((ancestor, index) => ( diff --git a/apps/web/src/components/ui/search/SearchModal/SearchModal.tsx b/apps/web/src/components/ui/search/SearchModal/SearchModal.tsx index 34032de6d..fa7f27f2a 100644 --- a/apps/web/src/components/ui/search/SearchModal/SearchModal.tsx +++ b/apps/web/src/components/ui/search/SearchModal/SearchModal.tsx @@ -10,7 +10,6 @@ const SearchModalBase = ({ className, ...props }: SearchModalProps) => { - console.log(className); return (