Define navigable regions in Dataviews layouts.#70954
Define navigable regions in Dataviews layouts.#70954vipul0425 wants to merge 2 commits intoWordPress:trunkfrom
Conversation
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| spacing={ 1 } | ||
| <div | ||
| role="region" | ||
| aria-label={ __( 'Data view actions' ) } |
There was a problem hiding this comment.
The natural next question is whether there should be a way to specify custom labels for implementers of data views.
The default label of 'Data view' doesn't seem right to me as I don't think any parts of the UI are ever called that. It's what we call it in our code, but not in the interface, so a user might not know what it means.
There was a problem hiding this comment.
Yes, should we introduce a new regionLabels prop that lets users pass in custom labels for different regions? Something like:
regionLabels?: {
actions?: string;
content?: string;
footer?: string;
}We could provide some sensible defaults like "View Controls", "Main Content", and "View Footer", but happy to adjust if you’d prefer a different approach for handling dynamic region labeling. 🙇
There was a problem hiding this comment.
We could provide some sensible defaults like "View Controls", "Main Content", and "View Footer", but happy to adjust if you’d prefer a different approach for handling dynamic region labeling. 🙇
Using general labels would be best for now.
t-hamano
left a comment
There was a problem hiding this comment.
Thanks for the PR!
I think this PR should get accessibility feedback as it has a significant accessibility impact.
I have three concerns:
- In the first place, should the regions be subdivided to this extent?
- More appropriate regions could be used, such as
search,contentinfo, etc. - I don't think
tabindex=-1is necessary. It doesn't need to be focusable by just the tab key.
|
I think it's reasonable to add some additional regions here; but they should be inside the Using the The footer area should be labeled based on its functionality.. which I think will make it very difficult to label. It contains pagination and bulk editing tools. Landmarks shouldn't change based on which view you're in; even though there isn't any bulk editing in the list view, the footer bar's label should be the same. But I think that the bulk editing tools are going to be very hard to find with this layout. I'm not sure how to label that peculiar combination of options. |
|
Thanks @joedolson 🙇 As per my understanding, you're referencing the top bar (which includes search, filters, and layout toggle) inside a role="region" with aria-label="Pages Top Bar" to mirror the post editor. Since this bar resides in the DataViews component and is reused across multiple screens, I couldn’t find any existing prop to pass a dynamic title. Would it make sense to introduce a new prop to support that? Please correct me if I’ve missed anything. Also, do we need to rename the upper section (where the page title and "Add Page" button reside), or is the current cc: @t-hamano |
What?
Closes #70950
Why?
When the site editor is open in pages or templates view, there are only two or three regions on the screen: "Navigation" (the left sidebar with a black background), "Pages" or "Templates" (the dataview) and, if in List layout, "Editor content". Whereas within the data view, there are header, main content and footer areas that can be made navigable regions.
How?
Define the header, actionable items, main content and footer as navigable regions.
Testing Instructions
Screenshots or screencast
Screen.Recording.2025-07-29.at.10.57.49.AM.mov