diff --git a/src/components/therapy-compass/screens/search-screen.tsx b/src/components/therapy-compass/screens/search-screen.tsx index da416d9e8..a71723ba7 100644 --- a/src/components/therapy-compass/screens/search-screen.tsx +++ b/src/components/therapy-compass/screens/search-screen.tsx @@ -7,7 +7,7 @@ import { import { useTcBindings } from "../bindings"; import { outlineControl, softControl } from "../controls"; -import { SearchIcon, SearchXIcon, XIcon } from "../icons"; +import { SearchXIcon, XIcon } from "../icons"; import { EmptyState, LoadingState } from "../ui"; import { ResultCard } from "../therapy-card"; @@ -24,29 +24,12 @@ export function SearchScreen() { return (
-

Therapy

-

- Find source-grounded therapy records by problem, symptom, skill or population. -

- -
- -
- diff --git a/src/components/therapy-compass/therapy-compass.css b/src/components/therapy-compass/therapy-compass.css index 3a7261ac4..7401aa9ca 100644 --- a/src/components/therapy-compass/therapy-compass.css +++ b/src/components/therapy-compass/therapy-compass.css @@ -2982,49 +2982,6 @@ max-width: 1180px; margin: 0 auto; } -.tc-root .tc-screens-search-screen-002 { - margin: 0 0 6px; - font-size: 27px; - font-weight: 680; - color: var(--text-heading); - letter-spacing: -0.02em; -} -.tc-root .tc-screens-search-screen-003 { - margin: 0 0 22px; - font-size: 14.5px; - color: var(--text-muted); -} -.tc-root .tc-screens-search-screen-004 { - display: flex; - gap: 12px; - align-items: center; - margin-bottom: 16px; - flex-wrap: wrap; -} -.tc-root .tc-screens-search-screen-005 { - flex: 1; - min-width: 260px; - position: relative; - display: flex; - align-items: center; -} -.tc-root .tc-screens-search-screen-006 { - position: absolute; - left: 16px; - color: var(--text-soft); -} -.tc-root .tc-screens-search-screen-007 { - width: 100%; - height: 52px; - padding: 0 16px 0 46px; - border: 1px solid var(--border-strong); - border-radius: 13px; - background: var(--surface); - color: var(--text); - font-size: 16px; - font-family: inherit; - box-shadow: var(--shadow-tight); -} .tc-root .tc-screens-search-screen-008 { display: flex; flex-wrap: wrap; diff --git a/tests/therapy-compass-mode-wiring.test.ts b/tests/therapy-compass-mode-wiring.test.ts index 5b10f836c..f2f172886 100644 --- a/tests/therapy-compass-mode-wiring.test.ts +++ b/tests/therapy-compass-mode-wiring.test.ts @@ -25,7 +25,7 @@ const therapyMetadataFiles = [ ]; describe("Therapy Compass production-mode wiring", () => { - it("uses Therapy for user-facing mode copy, search heading, and page metadata", () => { + it("uses Therapy for user-facing mode copy, search results ribbon, and page metadata", () => { const appModesSrc = readFileSync(new URL("../src/lib/app-modes.ts", import.meta.url), "utf8"); const homeSrc = readFileSync( new URL("../src/components/therapy-compass/screens/home-screen.tsx", import.meta.url), @@ -47,8 +47,13 @@ describe("Therapy Compass production-mode wiring", () => { expect(appModesSrc).toContain('label: "Therapy"'); expect(appModesSrc).toContain('submitAriaLabel: "Open Therapy"'); expect(homeSrc).toContain('title="Therapy"'); - expect(searchSrc).toContain('className="tc-screens-search-screen-002">Therapy'); + // Search route owns filters/results only; the results ribbon is the page h1. + expect(searchSrc).toContain("SearchResultsHeaderBand"); + expect(searchSrc).toContain("headingLevel={1}"); + expect(searchSrc).not.toContain("Search therapies"); + expect(searchSrc).not.toContain("Find source-grounded therapy records"); expect(workspaceSrc).toContain("Therapy could not load"); + // Therapy stays out of the six-item sidebar; mode discovery is via Tools/search. expect(sidebarSrc).not.toContain('id: "therapy-compass"'); expect(appModesSrc).not.toContain("Therapy mode"); expect(homeSrc).not.toContain("Therapy mode"); diff --git a/tests/ui-accessibility.spec.ts b/tests/ui-accessibility.spec.ts index 37a4182a1..e744d2040 100644 --- a/tests/ui-accessibility.spec.ts +++ b/tests/ui-accessibility.spec.ts @@ -516,11 +516,11 @@ test.describe("Clinical KB accessibility coverage", () => { await page.setViewportSize({ width: 390, height: 844 }); await page.goto("/therapy-compass/search", { waitUntil: "domcontentloaded" }); - await expect(page.getByRole("heading", { name: "Therapy", exact: true })).toBeVisible({ timeout: 60_000 }); await expect(page.getByRole("button", { name: "Search", exact: true })).toHaveAttribute("aria-current", "page"); const therapyRibbon = page.getByTestId("search-query-ribbon"); - await expect(therapyRibbon.getByRole("heading", { name: "All" })).toBeVisible(); + await expect(therapyRibbon.getByRole("heading", { name: "All", level: 1 })).toBeVisible({ timeout: 60_000 }); await expect(therapyRibbon.getByRole("group", { name: "Filter therapy results" })).toBeVisible(); + await expect(page.getByRole("textbox", { name: "Search therapies" })).toHaveCount(0); const therapyTopics = therapyRibbon.getByTestId("therapy-topic-filter-select"); const therapyAvailability = therapyRibbon.getByTestId("therapy-availability-filter-select"); await expect(therapyTopics).toBeVisible(); @@ -528,14 +528,13 @@ test.describe("Clinical KB accessibility coverage", () => { await expect(therapyAvailability).toBeVisible(); await expect(therapyAvailability).toHaveAccessibleName("Change therapy availability filters"); - const searchInput = page.getByRole("textbox", { name: "Search therapies" }); - await searchInput.focus(); - const inputFocus = await searchInput.evaluate((element) => { + await therapyTopics.focus(); + const topicsFocus = await therapyTopics.evaluate((element) => { const style = getComputedStyle(element); return { outlineStyle: style.outlineStyle, outlineWidth: Number.parseFloat(style.outlineWidth) }; }); - expect(inputFocus.outlineStyle).not.toBe("none"); - expect(inputFocus.outlineWidth).toBeGreaterThanOrEqual(2); + expect(topicsFocus.outlineStyle).not.toBe("none"); + expect(topicsFocus.outlineWidth).toBeGreaterThanOrEqual(2); await therapyTopics.selectOption("CBT"); await expect(therapyTopics.locator('option[value=""]')).toHaveText("1 topics selected"); diff --git a/tests/ui-route-coverage.spec.ts b/tests/ui-route-coverage.spec.ts index 20d32d92e..383f9f2c3 100644 --- a/tests/ui-route-coverage.spec.ts +++ b/tests/ui-route-coverage.spec.ts @@ -244,7 +244,10 @@ test.describe("previously uncovered production routes", () => { .getByRole("button", { name: "Anxiety in outpatient care", exact: true }); await expect(search).toBeEnabled(); await search.click(); - await expect(currentPage.getByRole("heading", { name: "Therapy", level: 1, exact: true })).toBeVisible(); + await expect( + currentPage.getByRole("heading", { name: "Anxiety in outpatient care", level: 1, exact: true }), + ).toBeVisible(); + await expect(currentPage.getByTestId("search-query-ribbon")).toBeVisible(); const nav = currentPage.getByRole("navigation", { name: "Therapy sections" }); // Phone: section nav portals into the header collapse host (outside // .tc-root). Read canvas colour from the workspace root still in the