-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
accessibilityWeb accessibility improvements (WCAG compliance)Web accessibility improvements (WCAG compliance)severity-highHigh severity issueHigh severity issuewcag-aWCAG Level A complianceWCAG Level A compliance
Description
Accessibility Issue: Tables Missing Proper Header Associations
WCAG Level: A
Severity: High
Category: Semantic HTML
Issue Description
Data tables throughout the application use <th> elements for headers but lack scope attributes, making it difficult for screen readers to associate data cells with their corresponding headers.
User Impact
- Affected Users: Screen reader users
- Severity: Users cannot understand the relationship between table headers and data cells
Violations Found
File: components/calculate/results-display.tsx
Lines: 228-236
<table className="w-full font-mono text-xs">
<thead className="sticky top-0 bg-zinc-900 text-zinc-500">
<tr>
<th className="px-3 py-2 text-left">#</th>
<th className="px-3 py-2 text-left">Element</th>
<th className="px-3 py-2 text-right">F<sub>x</sub></th>
<th className="px-3 py-2 text-right">F<sub>y</sub></th>
<th className="px-3 py-2 text-right">F<sub>z</sub></th>
<th className="px-3 py-2 text-right">|F|</th>
</tr>
</thead>Issue: Table headers lack scope="col" attribute
File: app/community/page.tsx
Lines: 206-219
<table className="w-full font-mono text-xs">
<thead className="bg-zinc-900 text-zinc-500">
<tr>
<SortHeader label="Formula" ... />
<th className="px-3 py-2.5 text-left">Type</th>
<th className="px-3 py-2.5 text-left">Model</th>
...
</tr>
</thead>Issue: Headers missing scope, SortHeader component may not include scope
File: components/semiconductor/defect-generator.tsx
Lines: 123-132
<table className="w-full font-mono text-xs">
<thead className="sticky top-0 bg-zinc-900 text-zinc-500">
<tr>
<th className="px-2 py-1.5 text-left">#</th>
<th className="px-2 py-1.5 text-left">Elem</th>
<th className="px-2 py-1.5 text-right">x</th>
<th className="px-2 py-1.5 text-right">y</th>
<th className="px-2 py-1.5 text-right">z</th>
</tr>
</thead>Issue: Atom positions table headers lack scope
Recommended Fix
<!-- Fixed Code -->
<table className="w-full font-mono text-xs">
<caption className="sr-only">Atomic forces table showing force components for each atom</caption>
<thead className="sticky top-0 bg-zinc-900 text-zinc-500">
<tr>
<th scope="col" className="px-3 py-2 text-left">#</th>
<th scope="col" className="px-3 py-2 text-left">Element</th>
<th scope="col" className="px-3 py-2 text-right">F<sub>x</sub></th>
<th scope="col" className="px-3 py-2 text-right">F<sub>y</sub></th>
<th scope="col" className="px-3 py-2 text-right">F<sub>z</sub></th>
<th scope="col" className="px-3 py-2 text-right">|F|</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row" className="...">1</th>
<td>C</td>
...
</tr>
</tbody>
</table>Changes Made:
- Add
scope="col"to all column headers - Consider
scope="row"for row headers (atom indices) - Add visually hidden
<caption>for table purpose - Update SortHeader component to include scope
Additional Instances
- All data tables in the application should be reviewed
Testing Instructions
- Use screen reader to navigate table
- Verify headers are announced with each cell
- Check that table purpose is clear from caption
- Navigate by rows and columns - headers should be associated
Resources
Acceptance Criteria
- All
<th>elements have appropriatescopeattribute - Complex tables have
<caption>element - Screen reader announces headers with cells
- SortHeader component updated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
accessibilityWeb accessibility improvements (WCAG compliance)Web accessibility improvements (WCAG compliance)severity-highHigh severity issueHigh severity issuewcag-aWCAG Level A complianceWCAG Level A compliance