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

Theme.json registered patterns missing in the Site Editor patterns view #55819

Closed
richtabor opened this issue Nov 2, 2023 · 4 comments · Fixed by #55877
Closed

Theme.json registered patterns missing in the Site Editor patterns view #55819

richtabor opened this issue Nov 2, 2023 · 4 comments · Fixed by #55877
Assignees
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@richtabor
Copy link
Member

richtabor commented Nov 2, 2023

TT4 adds two patterns via theme.json, which are available within the Inserter, but omitted from the Site Editor > Patterns view. I'd expect that the theme's patterns should each be listed in the Site Editor > Patterns view.

In the first screenshot, the 'clients-section' pattern is missing, but in the inserter, you can see it properly.

CleanShot 2023-11-02 at 12 20 47

CleanShot 2023-11-02 at 12 45 22

Related to #55109

@richtabor richtabor added [Type] Bug An existing feature does not function as intended [Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced labels Nov 2, 2023
@glendaviesnz
Copy link
Contributor

I see the clients pattern in the site editor on trunk:

Screenshot 2023-11-03 at 4 44 04 PM

I wonder what is different on your setup @richtabor ?

@t-hamano
Copy link
Contributor

t-hamano commented Nov 3, 2023

I tested it on the latest WordPress trunk and Gutenberg trunk, and I'm also seeing the same thing as @richtabor , but I think this is due to the difference in the specifications of the inserter and pattern page.

  • Inserter: Displays all themes and plugins, user patterns, and patterns from the pattern directory
  • Site editor patterns page: themes and plugins, user patterns

If you compare the number of patterns belonging to each category on the inserter and the pattern page, you will notice that the numbers are different.

Patterns defined in the patterns property of TT4's theme.json are categorized in the patterns directory in the inserter.

three-columns-of-services

three-columns-of-services

clients-section

clients-section

I don't know why @glendaviesnz can't reproduce this problem, but if the specification is that the pattern defined in the pattern property of theme.json is classified as a pattern directory source, I think this is the intended behavior.

@glendaviesnz
Copy link
Contributor

glendaviesnz commented Nov 5, 2023

I did a fresh install of TT4 on a site and was then seeing the same thing. @aaronrobertshaw can you remember the reasoning for not including these theme patterns in the site editor?

If we decide that we want these theme.json specified patterns to appear in the site editor this PR makes this change.

@aaronrobertshaw
Copy link
Contributor

@aaronrobertshaw can you remember the reasoning for not including these theme patterns in the site editor?

My recollection was that no pattern directory patterns were to be included in the Site Editor patterns page. If I follow the examples correctly, the TT4 patterns in question are remote patterns from the pattern directory and so given previous decisions omitted from the patterns page.

There was a plan to eventually allow remote patterns to be linked to from the Site Editor's Patterns page allowing users to copy those patterns to their local user-created patterns to manage further like those provided via files in a theme.

If we decide that we want these theme.json specified patterns to appear in the site editor #55877 makes this change.

I also have a vague recollection of there being some issues with nested remote patterns so it might be more involved than simply deleting the pattern-directory/theme source from the core patterns list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Patterns A collection of blocks that can be synced (previously reusable blocks) or unsynced [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants