GSA / notifications-admin

The UI of Notify.gov
https://notify.gov
Other
11 stars 2 forks source link

Send Message A11Y Audit - Cancel button for CSV upload not announced to screen reader #2138

Open jonathanbobel opened 1 day ago

jonathanbobel commented 1 day ago

Issue: Button Text Update for Upload Process Not Announced to Screen Readers

Problem:
During the SMS sending process, when uploading a CSV of phone numbers, the "Upload" button dynamically changes to "Cancel" immediately after clicking. This change:

  1. Lasts for only 1–3 seconds during the upload process.
  2. Not announced to screen readers, leaving assistive technology users unaware of the updated state.
  3. May confuse users because the action is available for such a brief window, making it difficult to act upon.

This design limits the experience for screen reader users and may create confusion for all users, especially if they miss the temporary "Cancel" state.


Proposed Solution:

Replace the "Cancel" button for short upload processes (1–3 seconds) with a non-interactive status message, such as "Uploading...". For longer uploads, ensure the "Cancel" option is accessible and actionable.


Implementation Details:

1. For Short Upload Durations (1–3 Seconds)

2. For Longer Upload Durations

3. Maintain Accessibility

4. Focus Management


Steps to Implement:

  1. Update the button text for the upload process:
    • Replace "Cancel" with "Uploading..." for short uploads.
    • Use "Cancel Upload" for longer uploads.
  2. Add aria-live and aria-atomic attributes to dynamically update and announce the button's state.
  3. Implement a timer to distinguish short uploads (1–3 seconds) from longer ones, applying the appropriate behavior.
  4. Test thoroughly for usability and accessibility.

Acceptance Criteria:


References:


This solution ensures the upload process is accessible and user-friendly, providing clear feedback and meaningful actions for all users.