-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Patterns: Improve the screenreader announcements for category navigation #52017
Conversation
Size Change: +56 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
Flaky tests detected in d8e6cc4. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5785034790
|
cc @afercia |
packages/edit-site/src/components/sidebar-navigation-screen-library/category-item.js
Outdated
Show resolved
Hide resolved
return ( | ||
<SidebarNavigationItem | ||
{ ...linkInfo } | ||
icon={ icon } | ||
suffix={ <span>{ count }</span> } | ||
aria-current={ isActive ? 'true' : undefined } | ||
aria-label={ ariaLabel } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This aria-label would make the accessible name pretty different from the visible text. While this adds contextual information for screen reader users, it would not help much speech recognition software users. For example:
VIsible text: Footers 1
Accessible name: Footers (template part), 1 item
Will detaile a bit better in a comment.
The only screen reader that would be effected by this is Voiceover. Voiceover exposes
I think having the category and count as description text really does not fit the bill here and needs to be a main label somehow. Just not sure how we please everyone. Sigh. |
I keep coming back to wanting to separate patterns and template parts in the main menu again. Even when knowing that separating them is temporary. I don't disagree with any of the things said here as part of the reviews, I was merely trying to work with what we have. |
Maybe, the number of items is not actually needed, -I don't believe that empty categories are listed. |
@carolinan Sounds good. I think excluding number of items here is likely fine. |
@carolinan Are you still working on this for 6.3 or does this still need design input? |
It still needs a new accessible design. |
As long as the needs design label is there, you can consider it as needing design. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good and this does improve things. 👍
How can we bring attention to this accessibility bug so that it is fixed for the next minor WP release? |
What?
Updated 11th of July 2023.
Closes #52005
When the original issue was opened, the Site Editor patterns page did not include information about if a category was for a pattern or a template part. The original PR aimed to address that.
Now, the patterns page has visible h2 headings above the different categories. These headings are not focusable but are announced by screen readers when reading the full content of the sidebar (navigation mode).
The updated PR attempts to implement the suggestion from the comment below:
Testing Instructions for Screen readers
Make sure that your WordPress install has some synced block patterns.
Activate a block theme, and the screen reader.
Open the Patterns page via the WordPress admin area > Appearance > Editor > Patterns.
Use the tab key to navigate past the initial links and buttons until you have passed the "Create pattern" button.
Using VoiceOver, navigating with tab key: Announces "My patterns, button.... more content available", Opening the more content menu announces "1" - the number of items in the category.
Pressing the tab key again will skip past the non-focusable heading for the template parts, and announce:
"Header, button .... more content available". Opening the more content menu announces "1" - the number of items in the category.
Using Voiceover, reading the full content of the sidebar:
Announces "My patterns, My patterns, button, 1" followed by "Heading level 2, Template parts, list, 3 items, Header, current item, Header, button, 2".
So in this case, there is a lot of repetition.