department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
281 stars 197 forks source link

Staging Review finding: Unnecessary `aria-label` on Add to Calendar and Directions elements #88451

Open shiragoodman opened 1 month ago

shiragoodman commented 1 month ago

Need help? Please review how to read a Staging Review ticket. Tag @platform-governance-team-members on Slack if you need further assistance.

Product Information

Team: Appointments Product: Appointments Feature: Appointment Details Redesign

Findings details

VA.gov Experience Standard - issue: User encounters a component or pattern that isn't considered a best practice. VA.gov Experience Standard - category: Consistency Launch-blocking: No Design System review: No Collab Cycle Reviewer: @briandeconinck (Accessibility)

Description

There are two instances on an appointment details page where an aria-label is added to an element but isn't necessary:

We typically add an aria-label to links and buttons in cases where it would be difficult for screen reader users to distinguish between two similar elements. In this case, there's only one "Add to calendar" on the page and one "Directions" on the page, and the purpose of each is clear from context. The aria-label makes each more verbose without any clear benefit.

There's also a trade-off to using aria-label for sighted voice command users. For them, the anticipated interaction pattern goes:

  1. Read the visible label "Add to calendar"
  2. Say the command "Click Add to calendar"
  3. Button is clicked.

But when an aria-label is present, voice command software attempts to match the spoken command ("Add to calendar") to what's in the accessibility tree ("Add [date] appointment to your calendar"). Some voice software is smart enough to recognize that as a close-enough match (eg. Dragon), other software will choke on it because it's not an exact match (eg. Apple Voice Control). There's an alternative path for voice users to interact with elements when an aria-label prevents a match, but if the aria-label isn't necessary then it's usually better to leave it off.

Link, screenshot or steps to recreate Examples of how these elements are currently coded: ``` ``` and ``` Directions ```

Recommended action

I recommend removing the aria-label from each of these. In a separate ticket Erin discusses adding visible text to warn users that the directions link opens in a new tab and/or opening in the same tag (following design system guidance), which should remove any need for an aria-label there.

References


Next Steps for the VFS Team

outerpress commented 1 month ago

@ldelacosta I'm good with removing the aria labels as @briandeconinck described. We might want to do the directions link work together with the work described in #88450. I'd keep the "open in a new window" work in the other ticket separate.