Skip to content

Add an Accessible Label for ZIP File Upload Input #247

Description

@arpit2006

Type

Accessibility

Severity

High

Location

frontend/src/app/pages/dashboard.tsx (around line 410)

Description

The ZIP archive upload control uses a visually hidden file input (className="hidden") that is triggered programmatically via an onClick handler attached to a generic <Button>. However, the hidden <input type="file"> does not have a unique id and is not associated with a corresponding <label> element.

Because the upload control lacks a proper programmatic label, assistive technologies cannot reliably associate the visible trigger with the underlying file input. This makes the upload functionality difficult or impossible to discover and operate for screen reader users.


User Impact

  • Screen reader users may not be able to identify the purpose of the file upload control.
  • Users relying on assistive technologies may be unable to trigger the ZIP upload workflow.
  • The application's primary scanning functionality becomes inaccessible to some users.
  • Reduced compliance with WCAG form accessibility requirements.

Steps to Reproduce

  1. Open the dashboard using a screen reader (e.g., NVDA, VoiceOver, or JAWS).
  2. Navigate to the ZIP upload section.
  3. Attempt to identify and activate the upload control.
  4. Observe that the hidden file input has no associated accessible label and is not properly connected to the visible trigger.

Expected Behavior

The visible upload control should be programmatically associated with the hidden file input so assistive technologies can correctly identify and activate the upload functionality.


Current Behavior

  • The hidden <input type="file"> has no associated <label>.
  • The file input lacks a unique id.
  • A generic <Button> triggers the input using JavaScript rather than semantic HTML.
  • Screen readers cannot reliably associate the visible control with the hidden input.

Recommended Fix

Update the upload control to use semantic HTML by associating the hidden file input with a visible label.

Possible improvements include:

  • Assign a unique id to the <input type="file">.
  • Replace the JavaScript-triggered button with a <label htmlFor="input-id"> styled as a button.
  • Ensure the label provides descriptive text such as "Upload ZIP Archive".
  • Preserve keyboard accessibility and screen reader compatibility.

Acceptance Criteria

  • The file input has a unique id.
  • A corresponding <label> is associated using the htmlFor attribute.
  • The upload control is fully operable using keyboard navigation.
  • Screen readers announce the upload control with a meaningful accessible name.
  • The existing upload functionality continues to work without regression.
  • Accessibility testing confirms the control is discoverable and operable with common screen readers.

Definition of Done

  • Hidden file input updated with an id.
  • Accessible label implemented.
  • Keyboard navigation verified.
  • Screen reader testing completed.
  • No regressions in the ZIP upload workflow.

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions