Skip to content
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

Ensure pattern categories always render in the Inserter #61320

Closed
scruffian opened this issue May 2, 2024 · 5 comments
Closed

Ensure pattern categories always render in the Inserter #61320

scruffian opened this issue May 2, 2024 · 5 comments
Assignees
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended

Comments

@scruffian
Copy link
Contributor

What problem does this address?

Since #61108, there are several conditions under which the patterns tab doesn't display patterns:

  1. There is no block selected
  2. The theme removes support for core block patterns: remove_theme_support( 'core-block-patterns' );
  3. The patterns haven't loaded yet.

In each of these cases we show this message in the patterns tab:

Screenshot 2024-05-02 at 11 48 30

What is your proposed solution?

We should treat each of these situations differently:

  1. We should still show the patterns and just insert them at the end of the content
  2. We show a message to explain why
  3. We show a loading placeholder

It would be useful to have designs for these states. cc @jasmussen @richtabor

@scruffian scruffian added [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. labels May 2, 2024
@jasmussen
Copy link
Contributor

jasmussen commented May 2, 2024

This issue feels very reminiscent of #60991, enough that if we can do this:

We should still show the patterns and just insert them at the end of the content

It would likely solve both. We might refine this to "nearest insertable location" rather than "at the end". But wouldn't that mainly be the case? And if we can solve this, do we need loading placeholders or messages?

@jasmussen
Copy link
Contributor

CC: @jameskoster

@richtabor
Copy link
Member

We could combine these into one no results found view:

CleanShot 2024-05-02 at 09 16 33

CleanShot 2024-05-02 at 09 16 39

There's already a spinner used when pulling results from the block directory.; we could reuse that UX pattern:

CleanShot 2024-05-02 at 09 17 29

As aside, but the Inserter should probably not render a "no results found" and a spinner at the same time.

@richtabor richtabor added [Type] Bug An existing feature does not function as intended and removed [Type] Enhancement A suggestion for improvement. Needs Design Needs design efforts. labels Oct 9, 2024
@richtabor
Copy link
Member

The theme removes support for core block patterns: remove_theme_support( 'core-block-patterns' );

I removed the needs design label. I think it's fine if the pattern inserter says "No results found" when there are no patterns.

Although if there are patterns insertable, you should see the pattern categories available. That we should resolve.

@richtabor richtabor changed the title Inserter: Patterns tab state Ensure pattern categories always render in the Inserter Oct 9, 2024
@richtabor richtabor added [Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Oct 9, 2024
@jorgefilipecosta jorgefilipecosta self-assigned this Nov 26, 2024
@jorgefilipecosta
Copy link
Member

jorgefilipecosta commented Nov 28, 2024

Although if there are patterns insertable, you should see the pattern categories available. That we should resolve.

It seems like this is already fixed. When there is no block selected, we can still use the inserter and see the pattern categories, the pattern is inserted at the end of the post.
The inserter already does not render a spinner and no results are found at the same time, if the patterns are loading only a spinner is rendered.

I'm going to close this issue, but I would appreciate if someone could double-check if I'm missing anything please feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Inserter The main way to insert blocks using the + button in the editing interface [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Type] Bug An existing feature does not function as intended
Projects
Development

No branches or pull requests

4 participants