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
16 changes: 16 additions & 0 deletions eslint.config.mjs
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,6 +5,22 @@ import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Accessibility: eslint-config-next only enables a narrow jsx-a11y subset
// (alt-text, aria-props, role validity). Add `label-has-associated-control`
// so a <label> that isn't wired to a control is caught in CI — a real markup
// smell the default config misses.
//
// The sibling rule `control-has-associated-label` (which flags an unlabeled
// <input>/<select>) is deliberately NOT enabled: it false-positives on this
// codebase's pervasive `<label><span>text</span><input/></label>` pattern
// (~13 correctly-labeled controls) and `depth` tuning does not clear them.
// Precise unlabeled-control detection belongs in a runtime axe-core check.
{
files: ["**/*.{jsx,tsx}"],
rules: {
"jsx-a11y/label-has-associated-control": "error",
},
},
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
Expand Down
30 changes: 26 additions & 4 deletions src/components/ClinicalDashboard.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,9 +62,9 @@
answerSurface,
chatMicroAction,
clinicalDivider,
clinicalNotesRow,

Check warning on line 65 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'clinicalNotesRow' is defined but never used
cn,
evidenceRow,

Check warning on line 67 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'evidenceRow' is defined but never used
EmptyState,
fieldControlPlain,
fieldControlWithIcon,
Expand DownExpand Up@@ -255,9 +255,9 @@
import {
type AnswerEvidenceMapRow,
type AnswerViewMode,
buildAnswerEvidenceMap,

Check warning on line 258 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'buildAnswerEvidenceMap' is defined but never used
buildClinicalOutputSections,

Check warning on line 259 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'buildClinicalOutputSections' is defined but never used
buildHighYieldClinicalOutputSections,

Check warning on line 260 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'buildHighYieldClinicalOutputSections' is defined but never used
shouldPollForUpdates,
} from "@/lib/ward-output";

Expand DownExpand Up@@ -478,7 +478,7 @@
return navigationHashes.includes(hash as (typeof navigationHashes)[number]) ? hash : "#search";
}

function WhyThisMatchedPanel({ sources }: { sources: SearchResult[] }) {

Check warning on line 481 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'WhyThisMatchedPanel' is defined but never used
const visibleSources = sources.slice(0, 3);
if (visibleSources.length === 0) return null;

Expand DownExpand Up@@ -1052,7 +1052,7 @@
function MobileEvidenceTabPanel({
tab,
renderModel,
query,

Check warning on line 1055 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'query' is defined but never used
visualEvidence,
answerEvidenceMapRows,
copiedQuotes,
Expand DownExpand Up@@ -1125,7 +1125,7 @@
return <EvidenceGapsPanel warnings={renderModel.warnings} />;
}

function UnifiedEvidenceDrawerContent({

Check warning on line 1128 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'UnifiedEvidenceDrawerContent' is defined but never used
answer,
renderModel,
query,
Expand DownExpand Up@@ -1318,8 +1318,8 @@
query,
safeAnswerText,
bestSource,
currentRelevance,

Check warning on line 1321 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'currentRelevance' is defined but never used
queryMode,

Check warning on line 1322 in src/components/ClinicalDashboard.tsx

View workflow job for this annotation

GitHub Actions/ verify

'queryMode' is defined but never used
sourceGovernanceWarnings,
sourceSummary,
renderModel,
Expand DownExpand Up@@ -2351,8 +2351,14 @@
{/* Dynamic Browse Library Filters */}
<div className="grid grid-cols-2 gap-2 sm:grid-cols-4">
<div>
<label className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]">Type</label>
<label
htmlFor="browse-filter-type"
className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]"
>
Type
</label>
<select
id="browse-filter-type"
value={selectedType}
onChange={(e) => setSelectedType(e.target.value)}
className="w-full mt-1 px-2.5 py-1.5 text-xs rounded-lg border border-[color:var(--border)] bg-[color:var(--surface)] text-[color:var(--text)] focus:border-[color:var(--primary)] focus:outline-none"
Expand All@@ -2367,8 +2373,14 @@
</select>
</div>
<div>
<label className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]">Site</label>
<label
htmlFor="browse-filter-site"
className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]"
>
Site
</label>
<select
id="browse-filter-site"
value={selectedSite}
onChange={(e) => setSelectedSite(e.target.value)}
className="w-full mt-1 px-2.5 py-1.5 text-xs rounded-lg border border-[color:var(--border)] bg-[color:var(--surface)] text-[color:var(--text)] focus:border-[color:var(--primary)] focus:outline-none"
Expand All@@ -2383,8 +2395,14 @@
</select>
</div>
<div>
<label className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]">Topic</label>
<label
htmlFor="browse-filter-topic"
className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]"
>
Topic
</label>
<select
id="browse-filter-topic"
value={selectedTopic}
onChange={(e) => setSelectedTopic(e.target.value)}
className="w-full mt-1 px-2.5 py-1.5 text-xs rounded-lg border border-[color:var(--border)] bg-[color:var(--surface)] text-[color:var(--text)] focus:border-[color:var(--primary)] focus:outline-none"
Expand All@@ -2399,10 +2417,14 @@
</select>
</div>
<div>
<label className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]">
<label
htmlFor="browse-filter-population"
className="text-[10px] font-bold uppercase tracking-wider text-[color:var(--text-soft)]"
>
Population
</label>
<select
id="browse-filter-population"
value={selectedPopulation}
onChange={(e) => setSelectedPopulation(e.target.value)}
className="w-full mt-1 px-2.5 py-1.5 text-xs rounded-lg border border-[color:var(--border)] bg-[color:var(--surface)] text-[color:var(--text)] focus:border-[color:var(--primary)] focus:outline-none"
Expand Down
Loading