WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.49k stars 4.19k forks source link

Tools panel: avoid unnecessary mismatch between visible label and accessible name #65241

Open afercia opened 1 month ago

afercia commented 1 month ago

Description

Similar to https://github.com/WordPress/gutenberg/issues/65112 and https://github.com/WordPress/gutenberg/issues/65235

In the Tools panel, the aria-label attributes for the elements that are shown / hidden and reset mismatch the visible text. As such, this is a mismatch between vissual label and actual accessible bane that is a barrier for some users.

This kind of mismatch should always be avoided. For example:

Worth also reminding the label of a control i.e. its accessible name isn not the right place to communicate states or values.

Screenshot 2024-09-11 at 15 42 39

https://github.com/WordPress/gutenberg/blob/b1c96760fee50cc0c885c5a030525cbfad83b0a9/packages/components/src/tools-panel/tools-panel-header/component.tsx#L101-L111

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Please confirm that you have tested with all plugins deactivated except Gutenberg.

afercia commented 1 month ago

I would argue that also from a visual design perspective, the entire tools panel purpose and functionality isn't clear.

Screenshot 2024-09-11 at 16 11 24

As a user, I'd only understand what this menu is about only after I try to use it and _only if I'm able to notice that new items appear or are removed from the main panel. To me, any UI should be self-explanatory instead of forcing users to 'try and discover' to learn how it works.