From ff88e1b0317f86342f2bbe02f25d9894b8426a32 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 11 Aug 2026 09:59:26 +0800 Subject: [PATCH 1/6] Fix cross-mode card on shared home --- AGENTS.md | 4 +++- src/components/ClinicalDashboard.tsx | 1 + tests/ui-universal-search.spec.ts | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 88ec727f80..483df4b4c6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,9 @@ # This is NOT the Next.js you know -This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` before writing any code. Heed deprecation notices. +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. diff --git a/src/components/ClinicalDashboard.tsx b/src/components/ClinicalDashboard.tsx index bdca9b0c45..3212a3d448 100644 --- a/src/components/ClinicalDashboard.tsx +++ b/src/components/ClinicalDashboard.tsx @@ -3033,6 +3033,7 @@ export function ClinicalDashboard({ // still mount on submission. Follow-ups hide the panel while loading so stale // matches for the prior query do not compete with the new Drafting stepper. const showUniversalAlsoMatches = + !showSharedHome && (modeSearchSubmitted || activeModeResultKind === "tools" || activeModeResultKind === "favourites") && Boolean(universalAlsoMatchesQuery.trim()) && (activeModeResultKind === "tools" || diff --git a/tests/ui-universal-search.spec.ts b/tests/ui-universal-search.spec.ts index 2127c6b318..d2b6208071 100644 --- a/tests/ui-universal-search.spec.ts +++ b/tests/ui-universal-search.spec.ts @@ -278,6 +278,14 @@ test.describe("universal search typeahead", () => { } }); + test("keeps submitted cross-mode matches off the unsubmitted shared home", async ({ page }) => { + await mockUniversalSearch(page); + const input = await openComposer(page, "/?mode=therapy&focus=1"); + await input.fill("acamprosate"); + + await expect(page.getByTestId("universal-also-matches")).toHaveCount(0); + }); + test("keeps compact cross-mode matches visible after submission", async ({ page }) => { await mockUniversalSearch(page); const universalRequest = page.waitForRequest(/\/api\/search\/universal(?:\?.*)?$/); From 31dc021372d10284d37fb8ba59c58383b9101897 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 11 Aug 2026 14:40:49 +0800 Subject: [PATCH 2/6] Adjust 1806 regression test to exercise submitted-to-draft flow --- tests/ui-universal-search.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/ui-universal-search.spec.ts b/tests/ui-universal-search.spec.ts index 04a1e4e811..abe143c338 100644 --- a/tests/ui-universal-search.spec.ts +++ b/tests/ui-universal-search.spec.ts @@ -280,6 +280,9 @@ test.describe("universal search typeahead", () => { test("keeps submitted cross-mode matches off the unsubmitted shared home", async ({ page }) => { await mockUniversalSearch(page); + await page.goto("/?mode=therapy-compass&q=acamprosate&run=1", { waitUntil: "domcontentloaded" }); + await expect(page.getByTestId("universal-also-matches")).toBeVisible(); + const input = await openComposer(page, "/?mode=therapy-compass&focus=1"); await input.fill("acamprosate"); From 1b0209463e4ddb9bb4520c79ea1511c41e3c7378 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 11 Aug 2026 15:39:07 +0800 Subject: [PATCH 3/6] Unblock cross-mode matches on submitted service/form/documents queries --- src/components/ClinicalDashboard.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/ClinicalDashboard.tsx b/src/components/ClinicalDashboard.tsx index 3212a3d448..cbe7b1aa82 100644 --- a/src/components/ClinicalDashboard.tsx +++ b/src/components/ClinicalDashboard.tsx @@ -3034,11 +3034,14 @@ export function ClinicalDashboard({ // matches for the prior query do not compete with the new Drafting stepper. const showUniversalAlsoMatches = !showSharedHome && - (modeSearchSubmitted || activeModeResultKind === "tools" || activeModeResultKind === "favourites") && Boolean(universalAlsoMatchesQuery.trim()) && (activeModeResultKind === "tools" || activeModeResultKind === "favourites" || - (activeModeResultKind === "answer" && Boolean(answer) && !loading)); + (activeModeResultKind === "answer" && Boolean(answer) && !loading) || + ((activeModeResultKind === "documents" || + activeModeResultKind === "services" || + activeModeResultKind === "forms") && + modeSearchSubmitted)); const showDesktopHomeComposer = !error && (showSharedHome || @@ -3636,7 +3639,12 @@ export function ClinicalDashboard({ ) : null)} - {showUniversalAlsoMatches && activeModeResultKind === "tools" ? ( + {showUniversalAlsoMatches && + (activeModeResultKind === "tools" || + activeModeResultKind === "favourites" || + activeModeResultKind === "documents" || + activeModeResultKind === "services" || + activeModeResultKind === "forms") ? ( ) : null} From 2dfce621922dfe597afa13e58e74b1a7c402a88d Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:21:48 +0800 Subject: [PATCH 4/6] Add also-matches panel to services and forms results --- src/components/forms/forms-search-results-page.tsx | 2 ++ src/components/services/services-navigator-page.tsx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/components/forms/forms-search-results-page.tsx b/src/components/forms/forms-search-results-page.tsx index 6cc1469704..98c820eb1f 100644 --- a/src/components/forms/forms-search-results-page.tsx +++ b/src/components/forms/forms-search-results-page.tsx @@ -36,6 +36,7 @@ import { SearchResultsEmptyState, SearchResultsHeaderBand, } from "@/components/clinical-dashboard/search-results-header-band"; +import { UniversalSearchAlsoMatches } from "@/components/clinical-dashboard/universal-search-also-matches"; import { ResultFilterTrigger } from "@/components/clinical-dashboard/result-filter-control"; import { FormCodeBadge } from "@/components/forms/form-code-badge"; import { Sheet } from "@/components/ui/sheet"; @@ -890,6 +891,7 @@ function FormsSearchResultsPageContent({ query }: FormsSearchResultsPageProps) { )} + ) : null}
{supportsPathwayClaims ? : null}
diff --git a/src/components/services/services-navigator-page.tsx b/src/components/services/services-navigator-page.tsx index 585926aa0d..cbf976c70f 100644 --- a/src/components/services/services-navigator-page.tsx +++ b/src/components/services/services-navigator-page.tsx @@ -29,6 +29,7 @@ import { SearchResultsHeaderBand, SearchResultsSkeleton, } from "@/components/clinical-dashboard/search-results-header-band"; +import { UniversalSearchAlsoMatches } from "@/components/clinical-dashboard/universal-search-also-matches"; import { ResultFilterSheet, ResultFilterTrigger, @@ -820,6 +821,7 @@ export function ServicesNavigatorPage() { /> ))} + )} From ab4701459cd95704554d462ffb38082961069d00 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:38:10 +0800 Subject: [PATCH 5/6] Add favourites page universal also-matches panel --- .../clinical-dashboard/favourites-command-library-page.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/clinical-dashboard/favourites-command-library-page.tsx b/src/components/clinical-dashboard/favourites-command-library-page.tsx index a757860f4a..517d1f57d2 100644 --- a/src/components/clinical-dashboard/favourites-command-library-page.tsx +++ b/src/components/clinical-dashboard/favourites-command-library-page.tsx @@ -44,6 +44,7 @@ import { SearchResultsEmptyState, SearchResultsHeaderBand, } from "@/components/clinical-dashboard/search-results-header-band"; +import { UniversalSearchAlsoMatches } from "@/components/clinical-dashboard/universal-search-also-matches"; import { appModeIcons } from "@/lib/app-mode-icons"; import { canAccessFavouritesMode } from "@/lib/app-modes"; import { DesktopComposerPortalSlot } from "@/components/desktop-composer-portal-slot"; @@ -1248,6 +1249,7 @@ export function FavouritesCommandLibraryPage({ query = "", demoMode }: { query?: onSelectItem={setSelectedItemId} /> )} + {selectedItem ? ( From 6340cd737b83e6f9e01ab8c61e156c8a62ae1f01 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Tue, 11 Aug 2026 17:57:04 +0800 Subject: [PATCH 6/6] fix: restore shared home suggestion ticker for merged head --- src/components/ClinicalDashboard.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/ClinicalDashboard.tsx b/src/components/ClinicalDashboard.tsx index cbe7b1aa82..198579a673 100644 --- a/src/components/ClinicalDashboard.tsx +++ b/src/components/ClinicalDashboard.tsx @@ -3366,6 +3366,7 @@ export function ClinicalDashboard({ composerFollowUpSuggestions={searchMode === "answer" ? answerFollowUpSuggestions : undefined} onPickComposerFollowUpSuggestion={handlePickFollowUpSuggestion} composerFollowUpSuggestionsDisabled={loading} + showPhoneSuggestionTickerOnHome={showSharedHome} sharedHomeIdentity={showSharedHome} composerPlaceholder={searchMode === "answer" && latestAnswerQuery ? "Ask a follow-up..." : undefined} mobileSearchPlacement={hasMobileBottomSearch ? "bottom" : "default"}