-
Notifications
You must be signed in to change notification settings - Fork 0
[A11Y] [Critical] Missing accessible names for interactive elements #3
Copy link
Copy link
Open
Labels
accessibilityWeb accessibility improvements (WCAG compliance)Web accessibility improvements (WCAG compliance)severity-criticalCritical severity issueCritical severity issuewcag-aWCAG Level A complianceWCAG Level A compliance
Description
Accessibility Issue: Missing Accessible Names for Interactive Elements
WCAG Level: A
Severity: Critical
Category: Form Accessibility / Keyboard Navigation
Issue Description
Several interactive elements (buttons, links, inputs) throughout the application lack accessible names. Screen readers cannot convey the purpose of these controls to users with visual impairments.
User Impact
- Affected Users: Blind and low-vision users
- Severity: Users cannot understand the purpose of interactive controls
Violations Found
File: components/calculate/file-upload-section.tsx
Lines: 78-84
<button
onClick={removeFile}
className="text-zinc-500 transition-colors hover:text-red-400"
>
<X className="h-4 w-4" />
</button>Issue: Button has no accessible name - only contains an icon
File: components/calculate/file-upload-section.tsx
Lines: 53-61
<input
type="file"
accept={ACCEPTED_FORMATS.join(",")}
onChange={handleFileInput}
className="absolute inset-0 cursor-pointer opacity-0"
/>Issue: File input has no associated label or aria-label
File: components/calculate/structure-preview.tsx
Lines: 139-148
<button
type="button"
onClick={handleClose}
title="Close preview"
className="text-zinc-500 transition-colors hover:text-red-400"
>
<X className="h-4 w-4" />
</button>Issue: Button relies only on title attribute, needs aria-label
File: components/calculate/molecule-viewer-3d.tsx
Lines: Multiple icon-only buttons in toolbar
Issue: Toolbar buttons (representation toggles, spin, reset) have no accessible names
Recommended Fix
<!-- Fixed Code -->
<button
onClick={removeFile}
aria-label="Remove file"
className="text-zinc-500 transition-colors hover:text-red-400"
>
<X className="h-4 w-4" aria-hidden="true" />
</button>Changes Made:
- Add
aria-labelto all icon-only buttons - Add
aria-hidden="true"to decorative icons - Add labels to file inputs via
aria-labelor associated<label>
Additional Instances
components/calculate/mlpeg-catalog.tsx(close button)components/calculate/results-display.tsx(download buttons)components/semiconductor/defect-generator.tsx(various buttons)components/mace-freeze/dataset-upload.tsx(remove button)app/mace-freeze/page.tsx(multiple toolbar buttons)
Testing Instructions
- Use screen reader (NVDA/JAWS/VoiceOver) to navigate to each button
- Verify button purpose is announced
- Use keyboard (Tab) to reach all interactive elements
- Confirm focus indicator is visible
Resources
Acceptance Criteria
- All icon-only buttons have aria-label
- File inputs have associated labels
- Tested with screen reader
- Keyboard navigation works as expected
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
accessibilityWeb accessibility improvements (WCAG compliance)Web accessibility improvements (WCAG compliance)severity-criticalCritical severity issueCritical severity issuewcag-aWCAG Level A complianceWCAG Level A compliance