Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better accessible name for Filters button and tab #957

Closed
obulat opened this issue Mar 20, 2023 · 5 comments · Fixed by #4396
Closed

Better accessible name for Filters button and tab #957

obulat opened this issue Mar 20, 2023 · 5 comments · Fixed by #4396
Assignees
Labels
♿️ aspect: a11y Concerns related to the project's accessibility ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend

Comments

@obulat
Copy link
Contributor

obulat commented Mar 20, 2023

Problem

#826 added a counter to the filters button and filters tab. The labels for these filters appear in two places:

Screenshots

Wider viewports:

image

image

Smaller viewports:

image

image

Description

Two things will need to be addressed here:

  1. Unifying the accessibility information available for both viewport sizes. Having an explicit aria-label is useful rather than relying on the textual content, since the order of the number and the word describing Filters could be different in other languages.
  2. Determining if {count} Filters is indeed the most accessible language here.

On the latter point, visually the button/tab conveys the notion that the filters are available under this button (if none are currently applied) or it shows the number of filters currently applied to the search along with the impression that the button is a controller for the filters pane. What is the best way to convey this meaning via text? Would something like Filters: {count} enabled or Filters: {count} applied be appropriate? Does {count} Filters work as-is?

@obulat obulat added 🟨 priority: medium Not blocking but should be addressed soon ✨ goal: improvement Improvement to an existing user-facing feature ♿️ aspect: a11y Concerns related to the project's accessibility 🧱 stack: frontend Related to the Nuxt frontend labels Mar 20, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Openverse Backlog Mar 20, 2023
@AetherUnbound AetherUnbound self-assigned this Apr 29, 2024
@openverse-bot openverse-bot moved this from 📋 Backlog to 📅 To Do in Openverse Backlog Apr 29, 2024
@AetherUnbound
Copy link
Collaborator

I've added more information to the issue body, and asked for some input from the accessibility Make WordPress Chat channel. If we're able to garner some advice on the appropriate wording for this, then this issue can be worked on. Until then, I'm going to moved it to blocked.

@AetherUnbound AetherUnbound added the ⛔ status: blocked Blocked & therefore, not ready for work label May 22, 2024
@openverse-bot openverse-bot moved this from 📅 To Do to ⛔ Blocked in Openverse Backlog May 22, 2024
@joedolson
Copy link

Having an explicit aria-label is useful rather than relying on the textual content, since the order of the number and the word describing Filters could be different in other languages.

I'm not sure that's actually relevant, since both the aria-label and the visible text should be translated. There are some specific accessibility problems caused by having a mismatch between the accessible name and the visible text, because voice control will respond to the accessible name, and if that doesn't match the visible name a user of voice control won't be able to trigger the button easily.

I think the most valuable change might just be word order; the action word should be first, with the supplemental values second. E.g. Filters (2). Adding additional terminology like (2 applied) could be useful, but isn't absolutely critical. In my opinion, it's better to have the visible text be the accessible name of the control than to add extra terms to try and add support for screen readers.

If we believe that Filters (2) is enough information for sighted people to figure out what it means, then we should accord screen reader users the same level of ability to interpret the interface. It's only necessary to add additional context if there is context that is clearly available to sighted users that is not available to screen reader users.

@AetherUnbound
Copy link
Collaborator

Thank you so much for your input @joedolson! That approach makes sense to me, @WordPress/openverse-frontend & @fcoveram - what are your thoughts?

@sarayourfriend
Copy link
Collaborator

Sounds good to me! It doesn't necessarily require a visual change, FWIW @AetherUnbound. You can set aria-hidden on the icon-or-filter-count component so that screen readers ignore it, then either add an sr-only text with the parenthised count in a more obvious position relative to the tab/button name, or set it directly on aria-label of the element.

The other PR I mentioned to you, #3941, did something along those lines to give clearer information for the screen reader to delineate the information that was otherwise available only visually... but did so without changing the visual presentation of the page.

The issue Madison mentioned about the word order was because of a difference in the desktop and mobile version of this bit of UI. The desktop button explicitly sets aria-label using a single translated string that includes the placeholder for the number of applied filters. The mobile version does not, and instead gets its accessible button name from the joined content of the button, rather than a single unified and translated string that incorporates the number when needed. We should fix that in the mobile version, for sure, so that they are translated together and identically 👍

@fcoveram
Copy link
Contributor

Sounds good to me! It doesn't necessarily require a visual change, FWIW @AetherUnbound. You can set aria-hidden on the icon-or-filter-count component so that screen readers ignore it, then either add an sr-only text with the parenthised count in a more obvious position relative to the tab/button name, or set it directly on aria-label of the element.

+1 to this. There are hidden elements in WordPres.org changes to enhance accessibility, so this approach sounds great to me.

@zackkrida zackkrida removed the ⛔ status: blocked Blocked & therefore, not ready for work label May 27, 2024
@zackkrida zackkrida moved this from ⛔ Blocked to 📅 To Do in Openverse Backlog May 27, 2024
@zackkrida zackkrida assigned zackkrida and unassigned AetherUnbound May 27, 2024
@openverse-bot openverse-bot moved this from 📅 To Do to 📋 Backlog in Openverse Backlog May 27, 2024
@openverse-bot openverse-bot moved this from 📋 Backlog to 📅 To Do in Openverse Backlog May 27, 2024
@openverse-bot openverse-bot moved this from 📅 To Do to 🏗 In Progress in Openverse Backlog May 28, 2024
@openverse-bot openverse-bot moved this from 🏗 In Progress to ✅ Done in Openverse Backlog May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♿️ aspect: a11y Concerns related to the project's accessibility ✨ goal: improvement Improvement to an existing user-facing feature 🟨 priority: medium Not blocking but should be addressed soon 🧱 stack: frontend Related to the Nuxt frontend
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants