WordPress / gutenberg

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

Command centre button: missing focus style and incorrect labeling #51460

Open afercia opened 1 year ago

afercia commented 1 year ago

Description

In the Site Editor, the button that opens the 'command centre' has a couple accessibility issues:

Minor: This whole chunk of HTML is invalid HTML:

Screenshot: this is how the accessible name of this button is announced by screen readers:

Screenshot 2023-06-13 at 15 19 00

Also worth noting that the visible text and the actual accessible name mismatch: this makes impossible to speech recognition software users issuing a vocal command. See WCAG 2.5.3 Label in Name. the best practice is to make sure that the actual accessible name matches, or at least starts, with the text that is visible to users.

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.

Yes

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

Yes

afercia commented 1 year ago

Note that this issue is in part connected with the existing issue about the main H1 in the Site editor and about what the H1 should communicate to users. To start with, seems to me placing the main H1 within this button is very far from ideal, as the button and the H1 should have very different purposes.

afercia commented 1 year ago

Additionally, go to:

Screenshot 2023-06-28 at 10 02 37
afercia commented 1 year ago

Additionally: when hovering one of the two buttons, the hover style changes also on the other button. I'm not sure this is a great idea, as it hints to user the whole thing is just one control, while they're actually two separate controls. Screenshot with default state and hover state:

Screenshot 2023-06-28 at 10 05 19

Noting this happens also in the Post editor.

I'm not sure I understand the reasoning behind making separate controls look like a single control in the first place. These are separate buttons and should visually appear as separate controls in the first place.

afercia commented 1 year ago

Additionally:

In the Post editor > Editing template mode, the buttons are separated with some spacing:

Screenshot 2023-06-28 at 11 38 49

In the Site editor instead, the 'Bacl' button is placed 'on top' of the other button. In the screenshot below, I shifted the Back button down a bit to illustrate it sits on top of the other button:

Screenshot 2023-06-28 at 10 49 46

This isn't ideal because, when restoring the focus style to be visible, focusing the Command centre button will draw an outline that ecompasses also the Back button, which would be an incorrect focus indication:

Screenshot 2023-06-28 at 10 50 18

Seems to me the whole CSS grid implementation should be removed and these buttons in the Site editor should use the same CSS flex styling of the buttons in the Post editor. The 'slide in' CSS animation would work in a slightly different manner but it would still work.

afercia commented 1 year ago

Assitionally: On small screens, the Post editor top bar layout breaks at various breakpoints:

post editor

The Site editor behaves a bit better, but still has problems at the smallest viewport sizes:

site editor