From b1dd8df61efb9b9b847363463a7071603cfa29f9 Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 28 Mar 2026 02:02:47 -0500 Subject: [PATCH] build search global --- frontend/src/pages/Gallery.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/pages/Gallery.tsx b/frontend/src/pages/Gallery.tsx index 5344670..8c60dea 100644 --- a/frontend/src/pages/Gallery.tsx +++ b/frontend/src/pages/Gallery.tsx @@ -49,12 +49,13 @@ export function Gallery() { setSearchTimer(t); } + const isSearching = !!debouncedSearch; const { data, isLoading, isError } = useMemes({ tag: activeTag ?? undefined, q: debouncedSearch || undefined, parent_only: true, - collection_id: activeCollectionId ?? undefined, - limit, + collection_id: isSearching ? undefined : (activeCollectionId ?? undefined), + limit: isSearching ? 200 : limit, }); const { data: tags } = useTags(); @@ -94,7 +95,7 @@ export function Gallery() { type="text" value={search} onChange={(e) => handleSearchChange(e.target.value)} - placeholder={`Search${activeCollection ? ` in ${activeCollection.name}` : ''}…`} + placeholder="Search all memes…" className="w-full bg-zinc-900 border border-zinc-700 rounded-lg pl-8 pr-3 py-1.5 text-sm focus:outline-none focus:border-accent placeholder-zinc-600" /> {search && ( @@ -206,12 +207,13 @@ export function Gallery() { : (() => { const count = data?.total ?? 0; const showing = data?.memes.length ?? 0; + const showing = data?.memes.length ?? 0; let label = `${count} meme${count !== 1 ? 's' : ''}`; if (isUnsorted && count > 50 && !debouncedSearch && !activeTag) { label = `Showing last 50 of ${count}`; } if (activeTag) label += ` tagged "${activeTag}"`; - if (debouncedSearch) label += ` matching "${debouncedSearch}"`; + if (debouncedSearch) label = `${showing} result${showing !== 1 ? 's' : ''} across all folders for "${debouncedSearch}"`; return label; })()}