diff --git a/src/components/clinical-dashboard/global-search-shell.tsx b/src/components/clinical-dashboard/global-search-shell.tsx index 186a0dac2c..285a8d7c77 100644 --- a/src/components/clinical-dashboard/global-search-shell.tsx +++ b/src/components/clinical-dashboard/global-search-shell.tsx @@ -260,30 +260,6 @@ function readInitialBrowserSubmittedSearchParamString(): string { return params.get("run") === "1" && query ? search : ""; } -export function infoPageBackHref(pathname: string): string | null { - if (pathname.startsWith("/services/")) return appModeHomeHref("services"); - if (pathname.startsWith("/forms/")) return appModeHomeHref("forms"); - if (pathname.startsWith("/medications/")) return appModeHomeHref("prescribing"); - if (pathname.startsWith("/differentials/")) return appModeHomeHref("differentials"); - if (pathname.startsWith("/dsm/")) return appModeHomeHref("dsm"); - if (pathname.startsWith("/specifiers/")) return appModeHomeHref("specifiers"); - if (pathname.startsWith("/formulation/")) return appModeHomeHref("formulation"); - if (pathname.startsWith("/therapy-compass/")) return appModeHomeHref("therapy-compass"); - if (pathname.startsWith("/factsheets/")) return appModeHomeHref("factsheets"); - if (pathname.startsWith("/documents/")) return documentsSearchHref(); - return null; -} - -/** Stable in-app back target for non-info mobile back (e.g. submitted differential search). */ -export function mobileBackHref(pathname: string, searchMode: string, hasQuery: boolean): string | null { - const infoHref = infoPageBackHref(pathname); - if (infoHref) return infoHref; - if (pathname === "/differentials" && searchMode === "differentials" && hasQuery) { - return appModeHomeHref("differentials", { focus: true }); - } - return null; -} - function isToolDetailWithFooterSearch(pathname: string): boolean { return ( (pathname.startsWith("/services/") && pathname !== "/services") || @@ -864,27 +840,6 @@ function GlobalStandaloneSearchShellBody({ onNewChat={startNewAnswerChat} showDesktopNewChat={!shouldShowDesktopSidebar} onOpenMobileSidebar={() => setMobileMenuOpen(true)} - mobileLeadingAction={ - isInfoPage - ? "back" - : pathname === "/differentials" && searchMode === "differentials" && requestedQuery - ? "back" - : "menu" - } - onMobileBack={() => { - const fallbackHref = mobileBackHref(pathname, searchMode, Boolean(requestedQuery)); - if (fallbackHref) { - if (!isInfoPage) setQuery(""); - router.push(fallbackHref); - return; - } - if (!isInfoPage) { - setQuery(""); - navigateToMode(searchMode, { focus: true }); - return; - } - router.back(); - }} queryModeOptions={mockupQueryModeOptions} queryInputRef={inputRef} recentQueries={recentQueries} diff --git a/src/components/clinical-dashboard/master-search-header.tsx b/src/components/clinical-dashboard/master-search-header.tsx index 31c32d47aa..17d59eabdd 100644 --- a/src/components/clinical-dashboard/master-search-header.tsx +++ b/src/components/clinical-dashboard/master-search-header.tsx @@ -29,7 +29,6 @@ import { Search, Send, ShieldCheck, - ArrowLeft, X, } from "lucide-react"; @@ -197,8 +196,6 @@ export function MasterSearchHeader({ desktopPageComposerSlotId, heroComposerBreakpoint = "all", mobileBottomSearchAddonSlotId, - mobileLeadingAction = "menu", - onMobileBack, hideOnScroll, onBottomComposerHiddenChange, showDesktopNewChat = true, @@ -263,8 +260,6 @@ export function MasterSearchHeader({ heroComposerBreakpoint?: "all" | "sm-up"; /** Mobile/tablet slot rendered above the search pill for page-specific composer addons. */ mobileBottomSearchAddonSlotId?: string; - mobileLeadingAction?: "menu" | "back"; - onMobileBack?: () => void; /** Phone-only hide-on-scroll for the universal header and bottom search dock. * "overlay" translates the sticky header away (host scrolls the document, * content already flows beneath); "collapse" also releases the header's @@ -604,7 +599,6 @@ export function MasterSearchHeader({ : "answer"; const actionMenuItems = modeActionItemsFor(actionMenuSetId); const actionMenuButtonLabel = `Open ${selectedAppMode.label.toLowerCase()} options`; - const useMobileBackControl = mobileLeadingAction === "back"; function currentUsesScopeSheet() { return window.matchMedia(scopeSheetMediaQuery).matches; @@ -2031,20 +2025,16 @@ export function MasterSearchHeader({