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({