-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Site editor: Fix the document title announcement for screen readers #56188
Comments
@alexstine I'm not sure entirely removing these announcements would be good for all users.
I had a look at the progressbar implementation and I doubt it can work correctly as it misses some important attributes like
Yes that is improved but I'm not sure it is sufficient. When testing #56167 upon navigation the announcement would only tell something about the back button. Something like:
and nothing else, which isn't great, in my opinion. |
I'll make a follow-up to fix |
@kevin940726 or @youknowriad Can you offer up any ideas on what might be setting incorrect page titles in the site editor?
I traced through the selectors and it looks like it tries to make a guess based off of template name and template type but the home page of the site editor should be neither of those. Need some custom fallback logic? I bet it's getting a default set somewhere and that's what makes it return the wrong page when the proper context can't be found. |
I think at the moment the The other thing is that as written today the "title" is guessed from the edited entity in the editor but in a lot of site editor pages, we always show the home page but the sidebar is different (templates, ...) so it makes more sense to tie the "title" to the "routing" instead. To be honest, the routing as implemented today in the site editor is very basic and adhoc and not well organized. I know @kevin940726 has started some explorations to improve the situations, maybe just a poc for now. But we will solve this properly once we have a solid routing system in place I think. |
@youknowriad Yeah, being able to properly tie the title to the path is likely a better solution going forward. I will not attempt to fix that in my PR, I will simply shorten the title as requested and leave this issue open for reference. Looks like this is going to be a much bigger effort than accessibility alone. Thanks. |
Description
Alternative to #56167
The Site Editor uses a 'single page app' navigation type, where navigating through the different views of the editor updates the content of the page but the HTML document is always the same.
As such, like in all single page apps, the navigation needs to be announced bt screen readers to emulate the native beheavir of a traditional navigation across different pages, where the document title is announced as first thing.
The current implementation in the Site editor uses a
speak()
to announce the updated document title and the site title, also appending the stringWordPress
:gutenberg/packages/edit-site/src/components/routes/use-title.js
Lines 38 to 58 in dc7e1aa
There's a few problems though:
<title>Blog Home ‹ Template ‹ Editor ‹ WordPress Develop — WordPress</title>
and that gets announced, which is misleading and doesn't reflect what is shown visually.<title>Blog Home ‹ Template ‹ Editor ‹ WordPress Develop — WordPress</title>
. This gets announced by screen readers and it's just wrong.Now displaying: Single Posts ‹ Template ‹ Editor ‹ WordPress Develop — WordPress
Suggested remediation:
‹ Editor ‹ WordPress Develop — WordPress
.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Wrong document title announced on the Templates view:
Wrong document title announced on the Navigation view:
Example of too verbose announcement:
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
The text was updated successfully, but these errors were encountered: