You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DataViews: Accessibility follow-ups from the bulk actions review - #86150
Fixes the follow-ups from Joe's review of #82730. One commit per item, so it's easy to split if that's preferred.
Why?
Each item makes DataViews harder to use with a keyboard, a screen reader, or a magnifier. Details are in #85052.
How?
Selection checkbox labels: they now say "Select [title]", like the list tables.
Bulk action announcements: "Bulk actions available." when selecting the first item, and "Bulk actions no longer available." when the user clears the selection. Only selection changes the user makes are announced. When the app clears the selection itself, e.g. after a trash, nothing is said, so the trash notice isn't cut off.
Focus after Trash: when the focused control is removed (the row's Actions button after a trash, for example), focus moves to "Select all", or to the first control of the layout if there's no checkbox.
Trash confirmation announcement: in the extensible site editor, removing the trashed post from the URL counted as a route change, so "Pages" was announced. speak() clears every live region, so that wiped the trash notice. The route title is now only announced when the path changes.
Dialog triggers: buttons and menu items for RenderModal actions get aria-haspopup="dialog". Quick Edit opens its modal from a callback, so I added an optional opensDialog flag to actions and set it on Quick Edit in both site editors. I left out aria-controls: the dialog only exists once it's open, and by then it covers the button.
Cancel button: the close icon is now a "Clear selection" text button, and it sits right after the actions instead of at the far end of the toolbar.
Thumbnails in the table: when the title next to the thumbnail is clickable, the thumbnail is out of the tab order and hidden from screen readers, so the cell no longer repeats the title. When the thumbnail is the only clickable control, it now has a focus ring. I didn't touch the grid: its thumbnail already takes its name from the visible title, and a test covers that on purpose.
Author avatars:alt="", since the name is right next to the avatar.
List items: each row was named after all of its content ("About us Edit Actions Status Draft"). It's now labelled by the title, and the fields stay as the item's description.
Checkbox contrast over images: grid checkboxes get a ring in the surface color, so they stand out on any preview. The picker grid gets the same.
Quick Edit image replacement: hovering or focusing the preview now shows a "Replace" hint in the bottom corner of the image. It's aria-hidden, since the preview's label already says "Replace [title]".
Testing Instructions
Site Editor → Pages, with a few pages (one with a featured image helps).
Table layout: row checkboxes read "Select [title]" in the accessibility tree.
With a screen reader on, check a row. You should hear "Bulk actions available." Uncheck it and you should hear "Bulk actions no longer available."
Open a row's Actions menu and choose Move to trash, then confirm. Focus lands on "Select all", not the page body.
With the gutenberg-extensible-site-editor experiment on, select a page, then trash it. The "moved to the trash" notice is announced and isn't replaced by "Pages".
The Trash and Quick edit buttons have aria-haspopup="dialog".
Select a page. A "Clear selection" button shows next to the bulk actions and clears the selection.
With a featured image in the table, Tab goes straight from the checkbox to the title link, not to the thumbnail first.
The author column doesn't announce "Author avatar".
Switch to the list layout. Each row is named by its title only.
Switch to the grid layout and hover a card whose image is dark or blue. The checkbox stands out.
Open Quick edit on a page with a featured image and hover the image. A "Replace" hint shows in the bottom corner of the image.
Testing Instructions for Keyboard
Tab to a row's Actions button, press Enter, choose Move to trash and confirm. Focus moves to "Select all".
Check a row with Space, then Tab to "Clear selection" and press Enter. The selection clears.
Screenshots or screencast
Bulk actions
Quick edit
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Co-authoring the fix. Reviewed and tested by me.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The focus fallback leaves keyboard focus on document.body when the last visible item is removed and can unexpectedly return focus to Select all after the user deliberately leaves the layout.
No open issues 🎉
2 previously missed issues
In code that hasn't changed since last review
Clear stale row focus when focus leaves the layout
Moving focus from a row to Search leaves lastFocused pointing at the row because this handler returns for any relatedTarget; if the user then clicks non-interactive content before filtering removes that row, the observer unexpectedly moves focus back to Select all. Clear the tracked control when focus deliberately leaves the layout for a non-modal control, while preserving modal/menu hand-offs.
Restore focus to a persistent control when the layout becomes empty
When the last remaining item (or the last item matching the current filter) is trashed, the layouts render only empty, so this branch has no future control to focus and leaves keyboard focus on document.body. Add a final fallback to a persistent DataViews control outside the layout, such as Search or View options, rather than only waiting for another layout mutation.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The empty-state fallback leaves a deleted row control tracked after focusing Search outside the container, allowing later mutations to unexpectedly pull focus back to Search.
Forget the focused control once focus moves on to another one, including a fallback outside the layout. Keep it while a menu, dialog or popover opened from the layout has focus, but not the dialog the whole view is in. Bring focus back to a control that is still there once loading ends, leave the items infinite scroll unloads alone, and fall back to the controls around a picker too.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The infinite-scroll exemption skips focus recovery for removed controls, leaving keyboard users on the document body when an action removes its focused trigger.
… off screen
Tell unloading apart from an action removing the focused item by whether the item was on screen, measured against the scroll container with a margin and ignoring sideways scrolling. Also forget a control hidden on its own, such as the table media, once focus leaves it, refocus without scrolling, and name list rows by their content when the title is empty.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
The document-wide focus-restoration changes span overlays, loading, and virtualized layouts, requiring integrated native keyboard and screen-reader validation unavailable in this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Closes #85052
Fixes the follow-ups from Joe's review of #82730. One commit per item, so it's easy to split if that's preferred.
Why?
Each item makes DataViews harder to use with a keyboard, a screen reader, or a magnifier. Details are in #85052.
How?
speak()clears every live region, so that wiped the trash notice. The route title is now only announced when the path changes.RenderModalactions getaria-haspopup="dialog". Quick Edit opens its modal from acallback, so I added an optionalopensDialogflag to actions and set it on Quick Edit in both site editors. I left outaria-controls: the dialog only exists once it's open, and by then it covers the button.alt="", since the name is right next to the avatar.aria-hidden, since the preview's label already says "Replace [title]".Testing Instructions
Site Editor → Pages, with a few pages (one with a featured image helps).
gutenberg-extensible-site-editorexperiment on, select a page, then trash it. The "moved to the trash" notice is announced and isn't replaced by "Pages".aria-haspopup="dialog".Testing Instructions for Keyboard
Screenshots or screencast
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Co-authoring the fix. Reviewed and tested by me.