From 38e5ea214ed5f88d366610c14f21f4bf68b64cd8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Jul 2026 15:39:11 +0000 Subject: [PATCH] fix: resolve CI failures - curly quotes, specifiers import, formatting --- docs/site-map.md | 19 +------------------ scripts/generate-site-map.ts | 9 +-------- src/app/page.tsx | 1 - .../universal-search-command-surface.tsx | 1 - src/lib/app-modes.ts | 11 ++++++++++- src/lib/universal-search-domains.ts | 10 +++++++++- tests/ui-smoke.spec.ts | 9 +++++---- tests/universal-search.test.ts | 14 +++++++++++--- 8 files changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/site-map.md b/docs/site-map.md index aad3840cd..345644133 100644 --- a/docs/site-map.md +++ b/docs/site-map.md @@ -679,23 +679,6 @@ This file is generated by `npm run sitemap:update`. Run `npm run sitemap:check` - `splitting` - `worry` -### Psychiatric specifier slugs - -- `/specifiers/[slug]` - Dynamic route family. -- `in-full-remission` -- `in-partial-remission` -- `mild-severity` -- `with-anxious-distress` -- `with-atypical-features` -- `with-catatonia` -- `with-melancholic-features` -- `with-mixed-features` -- `with-peripartum-onset` -- `with-psychotic-features` -- `with-rapid-cycling` -- `with-seasonal-pattern` - - ### Medication slugs - `/medications/[slug]` - Dynamic route family. @@ -808,7 +791,7 @@ This file is generated by `npm run sitemap:update`. Run `npm run sitemap:check` | Favourites | `src/app/favourites, src/components/clinical-dashboard/favourites-command-library-page.tsx` | | Differentials | `src/app/differentials, src/lib/differentials.ts` | | DSM-5 Diagnosis | `src/app/dsm, src/components/dsm, src/lib/dsm.ts` | -| Specifiers | `src/app/specifiers, src/components/specifiers, src/lib/specifiers.ts` | +| Specifiers | `src/app/specifiers (compatibility redirects to Formulation)` | | Formulation | `src/app/formulation, src/components/formulation, src/lib/formulation.ts` | | Medications | `src/app/medications, src/components/clinical-dashboard/medication-prescribing-workspace.tsx` | | Documents | `src/app/documents, src/lib/document-flow-routes.ts` | diff --git a/scripts/generate-site-map.ts b/scripts/generate-site-map.ts index cb0a8c714..f2060fb44 100644 --- a/scripts/generate-site-map.ts +++ b/scripts/generate-site-map.ts @@ -10,7 +10,6 @@ import { dsmDiagnoses } from "@/lib/dsm"; import { formulationMechanisms } from "@/lib/formulation"; import { formRecords } from "@/lib/forms"; import { serviceRecords } from "@/lib/services"; -import { specifierRecords } from "@/lib/specifiers"; const appDir = path.join(process.cwd(), "src", "app"); const siteMapPath = path.join(process.cwd(), "docs", "site-map.md"); @@ -105,7 +104,7 @@ const routeOwnershipRows = [ ["Favourites", "src/app/favourites, src/components/clinical-dashboard/favourites-command-library-page.tsx"], ["Differentials", "src/app/differentials, src/lib/differentials.ts"], ["DSM-5 Diagnosis", "src/app/dsm, src/components/dsm, src/lib/dsm.ts"], - ["Specifiers", "src/app/specifiers, src/components/specifiers, src/lib/specifiers.ts"], + ["Specifiers", "src/app/specifiers (compatibility redirects to Formulation)"], ["Formulation", "src/app/formulation, src/components/formulation, src/lib/formulation.ts"], ["Medications", "src/app/medications, src/components/clinical-dashboard/medication-prescribing-workspace.tsx"], ["Documents", "src/app/documents, src/lib/document-flow-routes.ts"], @@ -415,12 +414,6 @@ function renderSiteMapRaw(data = collectSiteMapData()) { formulationMechanisms.map((mechanism) => mechanism.id), ), "", - ...renderSlugInventory( - "Psychiatric specifier slugs", - "/specifiers/[slug]", - specifierRecords.map((record) => record.slug), - ), - "", ...renderSlugInventory("Medication slugs", "/medications/[slug]", medicationSlugs), ]), ...section("Document viewer route", [ diff --git a/src/app/page.tsx b/src/app/page.tsx index 2346e3479..5dc55d31b 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -83,4 +83,3 @@ export default async function Home({ searchParams }: HomeProps) { return ; } - diff --git a/src/components/clinical-dashboard/universal-search-command-surface.tsx b/src/components/clinical-dashboard/universal-search-command-surface.tsx index fae806850..edaa92c06 100644 --- a/src/components/clinical-dashboard/universal-search-command-surface.tsx +++ b/src/components/clinical-dashboard/universal-search-command-surface.tsx @@ -61,7 +61,6 @@ const modeIdByDomain: Record = { tools: "tools", }; - const domainHeadings: Record = { documents: "Documents", medications: "Medications", diff --git a/src/lib/app-modes.ts b/src/lib/app-modes.ts index ab70ef2f8..80c6ea5d7 100644 --- a/src/lib/app-modes.ts +++ b/src/lib/app-modes.ts @@ -20,7 +20,16 @@ export type AppModeId = (typeof appModeIds)[number]; export type SearchableAppModeId = AppModeId; export type AppModeSearchKind = - "answer" | "documents" | "services" | "forms" | "favourites" | "differentials" | "dsm" | "specifiers" | "formulation" | "tools"; + | "answer" + | "documents" + | "services" + | "forms" + | "favourites" + | "differentials" + | "dsm" + | "specifiers" + | "formulation" + | "tools"; export type AppModeResultKind = AppModeSearchKind; export type AppModeSearchConfig = { diff --git a/src/lib/universal-search-domains.ts b/src/lib/universal-search-domains.ts index 87b3dd83c..4c901983d 100644 --- a/src/lib/universal-search-domains.ts +++ b/src/lib/universal-search-domains.ts @@ -4,7 +4,15 @@ // browser bundle. universal-search.ts re-exports both names for server consumers. export type UniversalSearchDomain = - "documents" | "medications" | "services" | "forms" | "differentials" | "presentations" | "dsm" | "specifiers" | "tools"; + | "documents" + | "medications" + | "services" + | "forms" + | "differentials" + | "presentations" + | "dsm" + | "specifiers" + | "tools"; // Canonical order: the default group order in responses AND the topHit tiebreak when // several domains hold a confident (whole-phrase title) match. "dsm" sits before diff --git a/tests/ui-smoke.spec.ts b/tests/ui-smoke.spec.ts index f44dd60e5..913b33d75 100644 --- a/tests/ui-smoke.spec.ts +++ b/tests/ui-smoke.spec.ts @@ -2365,22 +2365,23 @@ test.describe("Clinical KB UI smoke coverage", () => { await expectNoPageHorizontalOverflow(page); }); - test("dashboard specifiers mode param redirects to the standalone specifiers route", async ({ page }) => { { + test("dashboard specifiers mode param redirects to the standalone specifiers route", async ({ page }) => { await page.setViewportSize({ width: 1280, height: 900 }); await mockDemoApi(page); await gotoApp(page, "/?mode=specifiers&q=anxious+distress&focus=1&run=1"); await expect(page).toHaveURL(/\/specifiers\?q=anxious\+distress&focus=1&run=1$/); - await expect(page.getByRole("heading", { level: 1, name: “Matches for “anxious distress”” })).toBeVisible(); + await expect(page.getByRole("heading", { level: 1, name: 'Matches for "anxious distress"' })).toBeVisible(); }); - test("dashboard formulation mode param redirects to the standalone formulation route", async ({ page }) => { await page.setViewportSize({ width: 1280, height: 900 }); + test("dashboard formulation mode param redirects to the standalone formulation route", async ({ page }) => { + await page.setViewportSize({ width: 1280, height: 900 }); await mockDemoApi(page); await gotoApp(page, "/?mode=formulation&q=I+keep+going+over+it&focus=1&run=1"); await expect(page).toHaveURL(/\/formulation\?q=I\+keep\+going\+over\+it&focus=1&run=1$/); await expect( - page.getByRole("heading", { level: 1, name: "Mechanisms matching “I keep going over it”" }), + page.getByRole("heading", { level: 1, name: 'Mechanisms matching "I keep going over it"' }), ).toBeVisible(); }); diff --git a/tests/universal-search.test.ts b/tests/universal-search.test.ts index fff2a3fcf..22c02caac 100644 --- a/tests/universal-search.test.ts +++ b/tests/universal-search.test.ts @@ -66,9 +66,17 @@ describe("runUniversalSearch (demo/fixtures path)", () => { demo: true, }); expect(response.groups.map((group) => group.kind)).toEqual( - ["documents", "medications", "services", "forms", "differentials", "presentations", "dsm", "specifiers", "tools"].filter( - (domain) => ["tools", "differentials"].includes(domain), - ), + [ + "documents", + "medications", + "services", + "forms", + "differentials", + "presentations", + "dsm", + "specifiers", + "tools", + ].filter((domain) => ["tools", "differentials"].includes(domain)), ); });