Skip to content

Consolidate BlockPatternsList component usages #66549

@ntsekouras

Description

@ntsekouras

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:

  1. Render patterns in a more narrow context like sidebars.
  2. Render patterns in dialogs for replace flows - usually from a toolbar button

In 'sidebars' we render them as a vertical list and the current usages are:

Usage Screenshot
Inserter patterns tabs
Design panel for replacing template parts and templates
There is an exception of the sidebar cases in the search results of the inserter, where we render the results as a two columns grid.

In dialogs:

Usage Screenshot
Change design for patterns in zoom out
Replace 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 with column-count css and not grid.
Explore all patterns render in a full screen modal with 3 columns in wide screens and 2 in smaller ones - uses grid css.
Swap template for pages under template dropdown render in a full screen modal with 2 two 4 columns based on viewport- uses column-count css. Similar usages with this one are: Choosing a starting template when creating a new page or a template.

Need feedback

  1. In all of our 'grid' implementations we use adhoc styles per use case. Some of them are identical, some are not (number of columns, masonry style or not, etc..). It makes sense to absorb this 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.
  2. Should the dialog implementations be considered as a third basic usage? Maybe the dialogs when creating new entities should remain in full screen dialogs, but the replace in Query Loop should probably be consolidated with the rest replace flows.
  3. We have the concept of 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 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] PatternsA collection of blocks that can be synced (previously reusable blocks) or unsynced[Type] Code QualityIssues or PRs that relate to code quality

    Type

    No type

    Projects

    Status

    Now

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions