From d93fe01eb8362a5907d6e5167962d261ee3ee617 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 6 Jul 2026 04:52:15 +0000 Subject: [PATCH 1/3] Restore desktop smart search suggestions Co-authored-by: BigSimmo --- .../universal-search-command-surface.tsx | 28 ++++++++++++++ tests/ui-overlap.spec.ts | 38 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/src/components/clinical-dashboard/universal-search-command-surface.tsx b/src/components/clinical-dashboard/universal-search-command-surface.tsx index 180cfa2e6e..0f8d56645d 100644 --- a/src/components/clinical-dashboard/universal-search-command-surface.tsx +++ b/src/components/clinical-dashboard/universal-search-command-surface.tsx @@ -8,6 +8,7 @@ import { type ModeActionId, type ModeActionSetId, } from "@/components/clinical-dashboard/mode-action-popup"; +import { AnswerSuggestionChips } from "@/components/clinical-dashboard/answer-suggestion-chips"; import { cn } from "@/components/ui-primitives"; import { appModeDefinition, type AppModeId } from "@/lib/app-modes"; import { appModeIcons } from "@/lib/app-mode-icons"; @@ -53,6 +54,25 @@ function OptionShell({ active, children, hint }: { active: boolean; children: Re export type CommandSurfacePlacement = "bottom-dock" | "inline"; +function ContextHintRow({ + examples, + onPickExample, +}: { + examples: string[]; + onPickExample: (example: string) => void; +}) { + return ( + + ); +} + function ScopeChipRow({ scopes, activeScopes, @@ -531,6 +551,14 @@ export function UniversalSearchCommandSurface({ placement === "bottom-dock" ? "gap-1" : "gap-2", )} > + { + onQueryChange(example); + onDropdownOpenChange(true); + onFocusSearchInput?.(); + }} + />
{ diff --git a/tests/ui-overlap.spec.ts b/tests/ui-overlap.spec.ts index 209abe4894..22a8d994e8 100644 --- a/tests/ui-overlap.spec.ts +++ b/tests/ui-overlap.spec.ts @@ -153,4 +153,42 @@ test.describe("Header element overlap coverage", () => { ).toBeLessThanOrEqual(geometry!.clearLeft + 1); }); } + + test("desktop smart search keeps suggested words above the composer", async ({ page }) => { + await page.setViewportSize({ width: 1280, height: 900 }); + await mockDemoDashboard(page); + await gotoHome(page); + + const suggestionRow = page.getByTestId("smart-search-suggestion-row"); + await expect(suggestionRow).toBeVisible(); + await expect(suggestionRow.getByRole("button", { name: "lithium level timing" })).toBeVisible(); + await expect(suggestionRow.getByRole("button", { name: "clozapine ANC monitoring" })).toBeVisible(); + + const geometry = await page.evaluate(() => { + const row = document.querySelector('[data-testid="smart-search-suggestion-row"]'); + const input = document.querySelector('[data-testid="global-search-input"]'); + if (!row || !input) return null; + const rowRect = row.getBoundingClientRect(); + const inputRect = input.getBoundingClientRect(); + return { rowBottom: rowRect.bottom, inputTop: inputRect.top }; + }); + + expect(geometry, "suggestion row and smart search input must render").not.toBeNull(); + expect(geometry!.rowBottom, "suggestions should sit above the smart search bar").toBeLessThanOrEqual( + geometry!.inputTop + 1, + ); + + await suggestionRow.getByRole("button", { name: "lithium level timing" }).click(); + await expect(page.locator('[data-testid="global-search-input"]:visible').first()).toHaveValue( + "lithium level timing", + ); + }); + + test("phone smart search does not show the desktop suggested words row", async ({ page }) => { + await page.setViewportSize({ width: 390, height: 820 }); + await mockDemoDashboard(page); + await gotoHome(page); + + await expect(page.getByTestId("smart-search-suggestion-row")).toBeHidden(); + }); }); From c1e9278062bb09b194ee92ca46e7adbaae97a67d Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 6 Jul 2026 04:54:13 +0000 Subject: [PATCH 2/3] Keep smart search suggestions desktop only Co-authored-by: BigSimmo --- src/app/globals.css | 10 ++++++++++ .../universal-search-command-surface.tsx | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/app/globals.css b/src/app/globals.css index d0971df7b1..b370d0fd53 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -1236,6 +1236,16 @@ summary::-webkit-details-marker { min-width: 0; } +.smart-search-suggestion-row { + display: none; +} + +@media (min-width: 1024px) { + .smart-search-suggestion-row { + display: flex; + } +} + .answer-suggestion-label { color: var(--text-soft); font-size: 0.6875rem; diff --git a/src/components/clinical-dashboard/universal-search-command-surface.tsx b/src/components/clinical-dashboard/universal-search-command-surface.tsx index 0f8d56645d..f7dcabc601 100644 --- a/src/components/clinical-dashboard/universal-search-command-surface.tsx +++ b/src/components/clinical-dashboard/universal-search-command-surface.tsx @@ -68,7 +68,7 @@ function ContextHintRow({ label="Suggested" testId="smart-search-suggestion-row" layout="scroll" - className="hidden lg:flex" + className="smart-search-suggestion-row" /> ); } From bf461ad01d46be8fab85c42e57d66ad8c5cb4623 Mon Sep 17 00:00:00 2001 From: BigSimmo <87357024+BigSimmo@users.noreply.github.com> Date: Mon, 6 Jul 2026 13:15:31 +0800 Subject: [PATCH 3/3] style: format universal-search-command-surface for CI --- .../universal-search-command-surface.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/clinical-dashboard/universal-search-command-surface.tsx b/src/components/clinical-dashboard/universal-search-command-surface.tsx index f7dcabc601..3052409011 100644 --- a/src/components/clinical-dashboard/universal-search-command-surface.tsx +++ b/src/components/clinical-dashboard/universal-search-command-surface.tsx @@ -54,13 +54,7 @@ function OptionShell({ active, children, hint }: { active: boolean; children: Re export type CommandSurfacePlacement = "bottom-dock" | "inline"; -function ContextHintRow({ - examples, - onPickExample, -}: { - examples: string[]; - onPickExample: (example: string) => void; -}) { +function ContextHintRow({ examples, onPickExample }: { examples: string[]; onPickExample: (example: string) => void }) { return (