-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Navigation Block List View: Improve the accessible Name of the Tree Grid inside the component. #47031
Conversation
Size Change: +82 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
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.
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.
I don't have the expertise to know quite how best to address this and whether it's appropriate.
It's seems sensible apart from the duplicate aria-label
packages/block-library/src/navigation/edit/menu-inspector-controls.js
Outdated
Show resolved
Hide resolved
Flaky tests detected in ff21a8f. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4073329420
|
const label = navigationMenu | ||
? sprintf( | ||
/* translators: %s: The name of a menu. */ | ||
__( 'Navigation menu: %s' ), | ||
navigationMenu.title | ||
) | ||
: __( 'You have not yet created any menus. Displaying a list of your Pages' ); |
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.
The piece that's missing is that this doesn't tell the user what kind of UI they're going to encounter. It might be worth keeping something closer to 'Block navigation structure' or 'List view' as the label in that respect. Possibly 'Navigation block list view'.
My feeling is that the context about the current state of the menu could be added as an aria description, as this is secondary information.
Would be good to get @alexstine's opinion on this.
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.
Yes. I do wonder whether mirroring what you did in #47047 would be a good option. Use an description to announce what the thing does.
This definitely requires accessibility feedback from an expert in this field.
See #44291 (review) for some context. TLDR, it may be best to keep the duplication. It could be worth adding a comment to the code to explain it. |
I think |
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.
@scruffian See one note below.
packages/block-library/src/navigation/edit/menu-inspector-controls.js
Outdated
Show resolved
Hide resolved
9887783
to
83c184e
Compare
Ok I've updated this to use
If you're happy with this then I'll also apply it to the List View component. Sidenote - |
That sounds good to me. Thanks. |
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.
One small fix left.
? sprintf( | ||
/* translators: %s: The name of a menu. */ | ||
__( 'Structure for navigation menu: %s' ), | ||
navigationMenu.title |
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.
We should handle a situation where this title
could be undefined. Just in case. I think I saw @talldan catch a similar bug on the Page List recently.
packages/block-library/src/navigation/edit/menu-inspector-controls.js
Outdated
Show resolved
Hide resolved
packages/block-library/src/navigation/edit/menu-inspector-controls.js
Outdated
Show resolved
Hide resolved
Update packages/block-library/src/navigation/edit/menu-inspector-controls.js Co-authored-by: Dave Smith <getdavemail@gmail.com> Update packages/block-library/src/navigation/edit/menu-inspector-controls.js Co-authored-by: Alex Stine <alex.stine@yourtechadvisors.com> switch to using a description rather than another label Update packages/block-library/src/navigation/edit/menu-inspector-controls.js Co-authored-by: Dave Smith <getdavemail@gmail.com>
I just cherry-picked this PR to the release/15.1 branch to get it included in the next release: 767b8dd |
…rid inside the component. (#47031) * Improve accessible Name of the Navigation Offcanvas List View Update packages/block-library/src/navigation/edit/menu-inspector-controls.js Co-authored-by: Dave Smith <getdavemail@gmail.com> Update packages/block-library/src/navigation/edit/menu-inspector-controls.js Co-authored-by: Alex Stine <alex.stine@yourtechadvisors.com> switch to using a description rather than another label Update packages/block-library/src/navigation/edit/menu-inspector-controls.js Co-authored-by: Dave Smith <getdavemail@gmail.com> * Apply suggestions from code review * disable linting * fix linter --------- Co-authored-by: Ben Dwyer <ben@escruffian.com> Co-authored-by: Dave Smith <getdavemail@gmail.com>
What?
This makes it possible to modify the name of the OffCanvasEditor component, so that it can be customized to the context it's being used in.
Why?
The previous label doesn't make sense in the Navigation List View context.
How?
Adds a prop to the OffCanvasEditor component. The List View component should also get this prop if this is the right way to achieve this.
Testing Instructions for Keyboard
Fixes #47022