From 75475aff8127ee2b755f5df46966a77f2f5b7e1b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 24 Aug 2026 11:01:35 +0000 Subject: [PATCH 1/8] =?UTF-8?q?feat(dictionary):=20keep=20Filter=20band=20?= =?UTF-8?q?always=20on,=20with=20Terms=20and=20A=E2=80=93Z=20under=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore the original results band on browse and search (count, optional query, clear, Filter). Compact Terms/Abbreviations and A–Z sit under that band instead of on the title row. A–Z stays visible during search and still filters, and clearing the query keeps the letter. Co-authored-by: BigSimmo --- .../search-results-header-band.tsx | 41 +++- .../dictionary/dictionary-catalogue-pages.tsx | 206 +++++++----------- src/lib/dictionary.ts | 40 ++-- tests/dictionary-data.test.ts | 44 ++-- tests/search-results-header-band.dom.test.tsx | 20 ++ tests/ui-dictionary.spec.ts | 68 +++--- 6 files changed, 203 insertions(+), 216 deletions(-) diff --git a/src/components/clinical-dashboard/search-results-header-band.tsx b/src/components/clinical-dashboard/search-results-header-band.tsx index d7943071a8..653233041e 100644 --- a/src/components/clinical-dashboard/search-results-header-band.tsx +++ b/src/components/clinical-dashboard/search-results-header-band.tsx @@ -147,6 +147,8 @@ export function SearchResultsHeaderBand({ filterLabel = "Filter search results", headingLevel = 2, resultNoun: resultNounOverride, + hideEmptyQuery = false, + emptyQueryLabel, className, }: { modeId: AppModeId; @@ -207,6 +209,14 @@ export function SearchResultsHeaderBand({ filterLabel?: string; /** Use level 1 when the ribbon is the route's primary page heading. */ headingLevel?: 1 | 2; + /** + * Hide the query subject when `query` is empty instead of falling back to + * "All". Dictionary browse keeps this band as count + Filter with no + * invented query chip. + */ + hideEmptyQuery?: boolean; + /** Accessible region name used when `hideEmptyQuery` omits the subject. */ + emptyQueryLabel?: string; /** * What this count counted, when the mode registry's noun is not specific * enough to be true. @@ -222,7 +232,10 @@ export function SearchResultsHeaderBand({ resultNoun?: string; className?: string; }) { - const displayQuery = query.trim() || "All"; + const trimmedQuery = query.trim(); + const displayQuery = trimmedQuery || "All"; + const showQuerySubject = Boolean(trimmedQuery) || !hideEmptyQuery; + const regionLabel = showQuerySubject ? `Search results for ${displayQuery}` : (emptyQueryLabel ?? "Catalogue"); // `status` wins when both are passed; `loading` is the deprecated shim. const resolvedStatus: SearchResultsBandStatus = status ?? (loading ? "loading" : "ready"); // The clinical invariant, expressed once: a search that failed has no count to @@ -297,7 +310,7 @@ export function SearchResultsHeaderBand({ return (
- - {displayQuery} - + {showQuerySubject ? ( + <> + + + {displayQuery} + + + ) : ( +