Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,3 @@ export default async function Home({ searchParams }: HomeProps) {

return <HomePageClient initialMode={initialSearchMode} />;
}

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ const modeIdByDomain: Record<UniversalSearchDomain, AppModeId> = {
tools: "tools",
};


const domainHeadings: Record<UniversalSearchDomain, string> = {
documents: "Documents",
medications: "Medications",
Expand Down
11 changes: 10 additions & 1 deletion src/lib/app-modes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
10 changes: 9 additions & 1 deletion src/lib/universal-search-domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/ui-smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2382,7 +2382,7 @@ test.describe("Clinical KB UI smoke coverage", () => {

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"' }),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve curly quotes in formulation heading assertions

For formulation searches, FormulationResults renders the accessible heading as Mechanisms matching “{query}” with typographic quotes. Replacing the invalid delimiter characters with a straight-quoted string here changes the expected accessible name to Mechanisms matching "I keep going over it", which does not match the page and will fail this Playwright smoke test whenever the formulation redirect path is exercised.

Useful? React with 👍 / 👎.

).toBeVisible();
});

Expand Down
14 changes: 11 additions & 3 deletions tests/universal-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
);
});

Expand Down