-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Consolidate BlockPatternsList component usages #66549
Comments
Aside from the 'Change design' example (which arguably feels more closely related to the sidebar placements) have we considered making these data views (in grid layout)? If so the task can be as simple as defining the data view config :) There may even base an argument for making the other examples data views too. Then we get search, filtering, and view options like grid density 'for free'. Just an idea. |
In some cases like the inserter or pattern explorer this could make sense, but I'm not sure it's needed for the rest. Having said that, we still need to consolidate all these usages. |
Totally agreed. Let's define which scenarios can use data views, then we can set about designing a component for the remaining ones. Like you said, Inserter and Pattern explorer make sense. Maybe 'Replace' in Query Loops and 'Swap template' too? |
Of course. I think that's part of it too. |
I've been made aware of some memory issues when the list of patterns becomes high. For instance in the swap template modal. I think we should give some priority to this consolidation work and also consider using DataViews internally within the component to address things like: pagination and search (solves the memory issues), grid configuration... |
I have this in mind and this consolidation also relates to work for moving the pattern fields (example here) in order to use the DataViews patterns internally, outside the |
It's not really clear to me that this should use these shared fields. The shared fields in So instead, if we're going to use DataViews here, we should just declare the fields locally within the BlockPatternsList component. |
Currently we render
BlockPatternsList
component in multiple places, but many of them have subtle differences, so it might be good to consolidate these designs and make the UI more consistent.We can probably say we have two basic usages of this component:
In 'sidebars' we render them as a vertical list and the current usages are:
Design panel
for replacing template parts and templatessidebar
cases in the search results of the inserter, where we render the results as a two columns grid.In dialogs:
Change design
for patterns in zoom outReplace
for Query Loop patterns. This toolbar item opens a full screen modal with 3 columns in wide screens and 2 in smaller ones and also renders the patterns in a masonry style withcolumn-count
css and notgrid
.Explore all patterns
render in a full screen modal with 3 columns in wide screens and 2 in smaller ones - usesgrid
css.Swap template
for pages undertemplate dropdown
render in a full screen modal with 2 two 4 columns based on viewport- usescolumn-count
css. Similar usages with this one are: Choosing a starting template when creating a new page or a template.Need feedback
grid
usage in the component itself with a new variant or something similar. In order to do that we need to decide what the final design for all them would be.replace
in Query Loop should probably be consolidated with the rest replace flows.replace
and some times we render it in toolbar and some times in inspector controls. Should we consolidate them or it makes sense as is?I'd love to hear some feedback from @WordPress/gutenberg-design , --cc @richtabor @jameskoster @jasmussen .
The text was updated successfully, but these errors were encountered: