diff --git a/docs/search-chrome-behaviour.md b/docs/search-chrome-behaviour.md index 10ef2f4ee0..2aef0f38a4 100644 --- a/docs/search-chrome-behaviour.md +++ b/docs/search-chrome-behaviour.md @@ -4,19 +4,20 @@ This repo uses one shared search experience across the global shell, dashboard r ## Page ownership model -| Page state | Composer placement | Reserve owner | -| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | -| Shared home (`/`, any mode) / standalone mode homes | In-flow hero composer on phones and larger breakpoints | Page content; no fixed phone dock reserve | -| Tools directory (`/tools`) and legacy alias (`/?mode=tools`) | No shared composer or phone dock; browse and filter through page-local catalogue controls | Idle shell padding only | -| Therapy Recommend (`/therapy-compass/recommend`) | In-flow clinical-situation composer; no shared composer or phone dock | Idle shell padding only | -| Submitted/search-result views | Compact bottom dock on phones; in normal page flow on tablets and desktops | Shell/dashboard `--mobile-composer-reserve` on phones; page content on desktop | -| Answer result view | Overlaid glass header plus answer composer dock | Dashboard `#main-content` top/bottom reserves | -| Document detail/source routes | `DocumentViewer` floating composer | `DocumentViewer` content padding | -| Document section navigation | Header row disclosure (phone sheet) + rail index card at `lg` | None — adds no chrome and no reserve | -| Record page breadcrumb header | Same header row without the disclosure or track; view mode inline from `sm` | None — portals into the phone collapse row, sticky at `sm+` | -| Calculators (`/calculators`) | In-flow hero composer at home; shared compact dock on `/calculators/search` (browse or submitted) | Page content at home; shell reserve for the catalogue and submitted results | -| Info/detail pages with no composer | No fixed composer | Idle shell padding only | -| Guide Centre dialog (`GuideDialog`) | No composer — tour-action dock inside the Sheet footer; Sheet footer band from `sm` | `[data-guide-content]` bottom pad (`guide-tour-dock` reserve owner) | +| Page state | Composer placement | Reserve owner | +| ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| Shared home (`/`, any mode) / standalone mode homes | In-flow hero composer on phones and larger breakpoints | Page content; no fixed phone dock reserve | +| Tools directory (`/tools`) and legacy alias (`/?mode=tools`) | No shared composer or phone dock; browse and filter through page-local catalogue controls | Idle shell padding only | +| Therapy Recommend (`/therapy-compass/recommend`) | In-flow clinical-situation composer; no shared composer or phone dock | Idle shell padding only | +| Submitted/search-result views | Compact bottom dock on phones; in normal page flow on tablets and desktops | Shell/dashboard `--mobile-composer-reserve` on phones; page content on desktop | +| Answer result view | Overlaid glass header plus answer composer dock | Dashboard `#main-content` top/bottom reserves | +| Document detail/source routes | `DocumentViewer` floating composer | `DocumentViewer` content padding | +| Document section navigation | Header row disclosure (phone sheet) + rail index card at `lg` | None — adds no chrome and no reserve | +| Record page breadcrumb header | Same header row without the disclosure or track; view mode inline from `sm` | None — portals into the phone collapse row, sticky at `sm+` | +| Calculators (`/calculators`) | In-flow hero composer at home; shared compact dock on `/calculators/search` (browse or submitted) | Page content at home; shell reserve for the catalogue and submitted results | +| Dictionary catalogue (`/dictionary/search`) | Compact bottom dock on phones; in-flow shared composer from `sm` up, under mode nav and above the Filter band | Shell `--mobile-composer-reserve` on phones; page content on desktop | +| Info/detail pages with no composer | No fixed composer | Idle shell padding only | +| Guide Centre dialog (`GuideDialog`) | No composer — tour-action dock inside the Sheet footer; Sheet footer band from `sm` | `[data-guide-content]` bottom pad (`guide-tour-dock` reserve owner) | The Tools row is scoped to the **mounted Tools directory**, not to `resultKind: "tools"`. Factsheets, Dictionary and Therapy Compass borrow that result kind purely as a benign search kind, and on the diff --git a/src/components/clinical-dashboard/global-search-shell.tsx b/src/components/clinical-dashboard/global-search-shell.tsx index b19977bf80..42e268739f 100644 --- a/src/components/clinical-dashboard/global-search-shell.tsx +++ b/src/components/clinical-dashboard/global-search-shell.tsx @@ -113,6 +113,7 @@ import { readSearchNavigationContext, type SearchNavigationOptions } from "@/lib import { isAlwaysStandaloneShellPath, isDashboardOwnedModeHomePath, + isDictionaryCataloguePath, isStandaloneModeHomePath, shouldRenderClinicalDashboard, shouldRenderDashboardSearch, @@ -468,6 +469,7 @@ function GlobalStandaloneSearchShellBody({ // searchMode before router.push landed, which made isStandaloneModeHome false // for one frame (dock reserve + 200ms padding transition = choppy resize). const isStandaloneModeHome = !hasSubmittedModeSearch && !rendersDashboardSearch && isStandaloneModeHomePath(pathname); + const isDictionaryCatalogue = isDictionaryCataloguePath(pathname); const isDifferentialPresentationWorkflow = pathname.startsWith("/differentials/presentations/"); const shouldShowDesktopSidebar = !hideDesktopSidebar; const effectiveSidebarCollapsed = isDifferentialPresentationWorkflow ? true : sidebarCollapsed; @@ -493,7 +495,9 @@ function GlobalStandaloneSearchShellBody({ // This flag controls sm+ padding for standalone mode homes. Tools has no // shared composer, so it cannot reserve floating-composer space. Phone // clearance is resolved separately from heroOwnsPhoneComposer below. - const reservesFloatingComposer = shouldShowSearchComposer && !isStandaloneModeHome; + // Dictionary catalogue keeps the usual compact phone dock; sm+ still + // portals into the in-page slot under mode nav (`desktopHomeComposerSlotId`). + const reservesFloatingComposer = shouldShowSearchComposer && !isStandaloneModeHome && !isDictionaryCatalogue; // Most standalone mode homes keep the in-flow hero pill at every width. Tools // deliberately has no shared composer. Document viewer routes own their own // floating composer, so @@ -963,13 +967,21 @@ function GlobalStandaloneSearchShellBody({ desktopSearchPlacement={desktopSearchPlacement === "hero" && isStandaloneModeHome ? "hero" : "default"} showPhoneSuggestionTickerOnHome={isStandaloneModeHome || (pathname === "/" && !hasSubmittedModeSearch)} searchComposerVisible={shouldShowSearchComposer} - desktopHomeComposerSlotId={isStandaloneModeHome ? modeHomeDesktopComposerSlotId : undefined} + desktopHomeComposerSlotId={ + isStandaloneModeHome || isDictionaryCatalogue ? modeHomeDesktopComposerSlotId : undefined + } desktopPageComposerSlotId={ - shouldShowSearchComposer && !isStandaloneModeHome ? desktopPageComposerSlotId : undefined + shouldShowSearchComposer && !isStandaloneModeHome && !isDictionaryCatalogue + ? desktopPageComposerSlotId + : undefined } // Most standalone homes keep the in-flow hero pill at every width. // Tools suppresses the shared composer at every breakpoint. - heroComposerBreakpoint={mobileHomeComposerPlacement === "footer" ? "sm-up" : "all"} + // Dictionary catalogue uses the usual compact phone dock; sm+ + // still portals into the in-page slot under mode nav. + heroComposerBreakpoint={ + mobileHomeComposerPlacement === "footer" || isDictionaryCatalogue ? "sm-up" : "all" + } // Phones: #main-content owns vertical scroll, so hide-on-scroll // collapses the top bar to hand space back to content. // Tablet and desktop portal search into normal page flow. The outer @@ -1046,7 +1058,7 @@ function GlobalStandaloneSearchShellBody({ data-testid="mobile-composer-reserve-pad" className="max-sm:pt-[var(--phone-overlay-chrome-h)] max-sm:pb-[var(--mobile-composer-reserve)]" > - {shouldShowSearchComposer && !isStandaloneModeHome ? ( + {shouldShowSearchComposer && !isStandaloneModeHome && !isDictionaryCatalogue ? ( - - {displayQuery} - + {showQuerySubject ? ( + <> + + + {displayQuery} + + + ) : ( +