Repository navigation
Conversation
Add two opt-in subcomponents to compose DataViews in narrow, single-purpose panels such as the block inserter: - DataViews.ViewMenu: a settings button that opens a menu with the filters that work as menu items (a short fixed list, one value at a time), sorting, "Reset view" and any extra items. - DataViews.FilterTabs: one filter shown as minimal tabs above the content. Both are also available in DataViewsPicker. Includes three Storybook stories (Narrow · Patterns, Narrow · Media, Narrow · Ineligible filters), documentation and unit tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add a `size` option so the settings button can sit next to a 40px control, such as the search field of the block inserter. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Add DataViews.NarrowUI, an alternative to the default UI for narrow containers. It takes the same data, fields and view, and renders an opinionated layout with a single settings button in place of the filters and the view options buttons. The settings menu now follows the filter each field already defines: radio items when it takes one value (`is`), checkboxes when it takes several (`isAny`), for lists of up to 10 options, the same limit after which the filters UI switches to a searchable list. Long menus move each group to a submenu. Replace the Patterns, Media and Ineligible filters stories with a single Narrow UI story on the content the other stories use. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Replace the DataViews.NarrowUI subcomponent with a `narrow` prop that renders the narrow UI in place of the default UI. It is a property of the UI around the content, so it applies to any layout: table, grid, list and activity. In Storybook, the separate Narrow UI story becomes a `narrow` control in the Layout Table, Layout Grid and Layout List stories. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Move `narrow` from a DataViews prop to an option of the grid layout, set in `view.layout`. The table and list layouts no longer take it. Add the same option to the `pickerGrid` layout of DataViewsPicker, where the footer keeps the selection, the pagination and the actions, with the actions on a line of their own. In Storybook, the control stays in the Layout Grid story and is added to the picker's Default story, in a contained, borderless, full-height frame like the Layout Activity story. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`onReset` is meant for saved views and comes with the "modified" indicator of the view options button, which the settings button doesn't have. The menu only holds a few groups of options, each with its default one click away, and a consumer that needs a reset item can add it through `children`. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A filter left the menu once its list had more than 10 options. A list is often open to extension, such as the sources or categories that plugins register, and a filter that drops out of the menu leaves no way to change it in the narrow UI. A long list now moves to a submenu, which scrolls. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
When the menu holds a single group, a submenu only adds a step to reach it. The group now stays in the menu however long it is, and the menu scrolls. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Replace the hand-made source menu and the Tabs wrapper around the grid with the two DataViews subcomponents for narrow panels. The source and the media type are modelled as fields with elements, so they live in `view.filters`. `onChangeView` translates them back to the tab's existing state, which still decides what the panel fetches. The menu holds Source and "Reset view". It has no sorting, because a media request only carries the search term and the page. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Replace the two-step Patterns tab (a list of categories, then a panel of patterns) with one sidebar built from the same DataViews subcomponents as the Media tab, so the two tabs browse alike. The tab opens on "All" patterns. - The pattern categories are tabs, in today's order. - Source and Type move to the settings menu, with "Reset view" and a link in place of the help paragraph. - Every pattern inserts on click or with the keyboard, and can be dragged onto the canvas. - Search keeps the existing pattern ranking, within the selected tab. - DataViews pagination replaces the patterns paging, at the same 20 per page. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`DataViews.ViewMenu` no longer has a "Reset view" item, and the menu only holds the source, where the default is one click away. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The source has no "All" option: "Theme & Plugins" is the default, and the menu lists it first. The tabs follow the source, showing the categories it has patterns in, and a source without patterns is not offered, so no choice leads to an empty list. The "Type" options show for the "User" source only, the one with synced patterns, and the site's own patterns are that source in place of a tab of their own. Also removes the "About pattern sources" link and the reset from the menu. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… sources "User" becomes "Site patterns", and "My patterns" is added after it for the patterns the current user made. It is offered only while those are some of the site's patterns and not all of them, so a site with a single author doesn't get two options listing the same. The sources are ordered from the farthest from the person editing to the closest, with "Theme & Plugins" still the default. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
🤖 PR meta 🤖🎉 PropsIf 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
Updated as activity occurs, without notifying anyone named here. Add the |
|
I would love your thoughts on this @andrewserong and @ramonjd |
|
Thanks for the ping @fcoveram, lots of cool work here! What kind of feedback are you interested in at this stage? Without having looked at any of the code in this or #87393, a couple of quick impressions:
2026-11-26.10.06.44.mp4
Thanks again for digging in here and working toward coming up with a common pattern for this kind of narrow layout! Another thought is that this doesn't necessarily need to be coupled to Grid as the list beneath the header area could also be a list, potentially? I'm also curious about how much needs to be coupled to DataViews layouts vs just part of how DataViews can be composed, but that's possibly more of a question for #87393 — you make the point there that it's made available through free composition, so that might already answer that part of my question here 🙂 Let us know if there's anything in particular you'd like more detailed thoughts on! |
Thank you for getting this up for testing. 🚀 I don't have much time to dive into it this week. Still, some thoughts came to mind while looking at the screenshot. Just so I understand, is the main case here consistency (scrolling vs paging) with other screens? Patterns showing up as soon as the tab opens is I think a worthy improvement. If they're not already, I thinking that we could prioritize my patterns and site patterns in the list. I'm not sure they're the ones users would reach for the most, I'm only assuming since they'd be the categories closest to the site itself. Also does search search all or just the selected type? |
|
Sorry for not being enough clear on why the ping. I’m looking for feedback on two things:
Regarding tabs for categories, thanks for the context @andrewserong. I revisited #86414 and I like the idea, but the select with a plus action feels that could be simpler. DataViews offers a way of filtering, but the current design is heavy for this context. I've been playing with an idea and this version feels like a good path. Patterns tab
Media tab
It keeps the filter row permanent and uses Also curious about what @WordPress/gutenberg-design think of this.
Yes. Just as reported in #85552
Just the selected type. The search placeholder could be better communicating this. |



What?
Part of #85552. Depends on #87393.
A proof of concept for the inserter panel. The Patterns and Media tabs browse the same way, both built with the work in #87393, which adds two parts to DataViews for narrow panels:
DataViews.ViewMenu(a single settings button) andDataViews.FilterTabs(one field shown as tabs).Both tabs have the same rows, from top to bottom:
The Blocks tab is not changed.
Why?
#85552 looks at how content is browsed in the inserter panel, where Blocks, Patterns and Media each work differently. The discussion there leans towards a similar experience across the tabs, with a more opinionated DataViews configuration. #87393 proposes that configuration, and this applies it to two of the tabs to see it with real content:
How?
Patterns
Media
DataViews.ViewMenureplaces the tab's own source menu, andDataViews.FilterTabsreplaces its own tabs.In both tabs
elements, and the selection is inview.filters. The menu and the tabs are generated from them, as in DataViews: Add a narrow UI to the grid layout #87393.narrowlayout option, because each tab needs its own search and footer.Content from plugins and themes
Nothing in the two tabs is listed by hand. They show what is registered, so what a plugin or a theme adds is there with no further work:
registerInserterMediaCategoryis a source in the menu, in the order it was registered. The menu takes as many as there are, and scrolls. Tested with 13 sources registered from the console.register_block_pattern_categoryis a tab, under the sources that have patterns in it. The tabs scroll sideways.register_block_patternshows under "Theme & Plugins", in the tabs of its categories.What it doesn't cover:
Open questions
Not done yet:
CategoryTabsandMobileTabNavigationare left unused. The Patterns tab reuses the Media tab's class names, and overrides the aspect ratio of the grid's media so that each preview keeps its height.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Patterns
DV.patterns.flow.01.mp4
Media
DV.media.flow.01.mp4
Use of AI Tools
I used Claude Code to write the code and tests in this pull request from my design brief and wireframes, and to draft this description. I made the design decisions and reviewed the result in the editor.
🤖 Generated with Claude Code