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
8 changes: 5 additions & 3 deletions src/components/clinical-dashboard/differentials-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,13 @@ function ResultTypeTabs({
{ id: "diagnosis" as const, label: "Diagnoses", count: diagnosisCount },
];

// Single-select filters over one results list — modeled as a toggle group
// (role="group" + aria-pressed), not ARIA tabs (which would need tabpanels,
// aria-controls, and roving tabindex for content that does not exist here).
return (
<div
data-testid="differential-result-type-tabs"
role="tablist"
role="group"
aria-label="Result type"
className="polished-scroll flex max-w-full items-center gap-1 overflow-x-auto rounded-lg border border-[color:var(--border)] bg-[color:var(--surface-raised)] p-1 shadow-[var(--shadow-inset)]"
>
Expand All @@ -289,8 +292,7 @@ function ResultTypeTabs({
<button
key={tab.id}
type="button"
role="tab"
aria-selected={active}
aria-pressed={active}
aria-label={`${tab.label} (${tab.count})`}
onClick={() => onFilterChange(tab.id)}
className={cn(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function GlobalStandaloneSearchShellClient({
? "max-sm:pb-[var(--mobile-composer-reserve)] sm:pb-[calc(9rem+env(safe-area-inset-bottom))]"
: useCompactBottomSearch
? "max-sm:pb-[var(--mobile-composer-reserve)] sm:pb-8"
: "max-sm:pb-[var(--mobile-composer-reserve)] sm:pb-[calc(9rem+env(safe-area-inset-bottom))] sm:pb-8",
: "max-sm:pb-[var(--mobile-composer-reserve)] sm:pb-[calc(9rem+env(safe-area-inset-bottom))]",
)}
>
<div className="max-sm:flex max-sm:min-h-0 max-sm:flex-1 max-sm:flex-col">
Expand Down
16 changes: 8 additions & 8 deletions tests/ui-tools.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1263,11 +1263,11 @@ test.describe("Clinical KB tools launcher", () => {
await expect(page.getByTestId("differentials-search-results")).toBeVisible();
const tabs = page.getByTestId("differential-result-type-tabs");
await expect(tabs).toBeVisible();
await expect(tabs.getByRole("tab", { name: /All \(\d+\)/ })).toBeVisible();
await expect(tabs.getByRole("tab", { name: /Presentations \(\d+\)/ })).toBeVisible();
await expect(tabs.getByRole("tab", { name: /Diagnoses \(\d+\)/ })).toBeVisible();
await expect(tabs.getByRole("button", { name: /All \(\d+\)/ })).toBeVisible();
await expect(tabs.getByRole("button", { name: /Presentations \(\d+\)/ })).toBeVisible();
await expect(tabs.getByRole("button", { name: /Diagnoses \(\d+\)/ })).toBeVisible();

const tabMetrics = await tabs.getByRole("tab").evaluateAll((buttons) =>
const tabMetrics = await tabs.getByRole("button").evaluateAll((buttons) =>
buttons.map((button) => {
const rect = button.getBoundingClientRect();
return { height: rect.height, scrollHeight: button.scrollHeight };
Expand Down Expand Up @@ -1359,11 +1359,11 @@ test.describe("Clinical KB tools launcher", () => {
await expect(page.getByTestId("differentials-search-results")).toBeVisible();
const tabs = page.getByTestId("differential-result-type-tabs");
await expect(tabs).toBeVisible();
await expect(tabs.getByRole("tab", { name: "All (8)" })).toBeVisible();
await expect(tabs.getByRole("tab", { name: "Presentations (1)" })).toBeVisible();
await expect(tabs.getByRole("tab", { name: "Diagnoses (7)" })).toBeVisible();
await expect(tabs.getByRole("button", { name: "All (8)" })).toBeVisible();
await expect(tabs.getByRole("button", { name: "Presentations (1)" })).toBeVisible();
await expect(tabs.getByRole("button", { name: "Diagnoses (7)" })).toBeVisible();

const tabMetrics = await tabs.getByRole("tab").evaluateAll((tabElements) =>
const tabMetrics = await tabs.getByRole("button").evaluateAll((tabElements) =>
tabElements.map((tab) => {
const rect = tab.getBoundingClientRect();
return { height: rect.height, scrollHeight: tab.scrollHeight };
Expand Down