diff --git a/src/frontend/src/components/ReleaseModal.tsx b/src/frontend/src/components/ReleaseModal.tsx index 9ee851a2..c7548554 100644 --- a/src/frontend/src/components/ReleaseModal.tsx +++ b/src/frontend/src/components/ReleaseModal.tsx @@ -1801,8 +1801,13 @@ const ReleaseModalSession = ({ - {/* Center: Results count from release sources */} -
+ {/* Results count from release sources. Deliberately not flex-1: a + second growing child would halve the scrollable tab strip beside + it, and it would claim that space even on tabs whose source + reports no total (only direct_download does). Hidden below sm: + the label is ~150px and the full-screen mobile modal has no room + for it without pushing the tabs out of reach. */} +
{(() => { const searchInfo = releasesBySource[activeTab]?.search_info?.[activeTab]; const totalCount = searchInfo?.total_results; diff --git a/src/frontend/src/hooks/useSearch.ts b/src/frontend/src/hooks/useSearch.ts index 9c0b003c..973a0382 100644 --- a/src/frontend/src/hooks/useSearch.ts +++ b/src/frontend/src/hooks/useSearch.ts @@ -210,6 +210,7 @@ export function useSearch(options: UseSearchOptions): UseSearchReturn { setLastSearchQuery(''); setHasMore(false); setTotalFound(0); + setDirectTotalResults(null); setCurrentPage(1); setResultsSourceUrl(undefined); setResultsSourceTitle(undefined); @@ -219,10 +220,13 @@ export function useSearch(options: UseSearchOptions): UseSearchReturn { setIsSearching(true); setLastSearchQuery(query); - // Reset pagination for new search + // Reset pagination for new search. directTotalResults belongs to direct mode + // and is never written here, so without clearing it a count from an earlier + // direct search survives the mode switch and renders over these results. setCurrentPage(1); setHasMore(false); setTotalFound(0); + setDirectTotalResults(null); try { const result = await searchMetadata(