Skip to content

Conversation

@ryelle
Copy link
Contributor

@ryelle ryelle commented Dec 18, 2024

A brief history: When the Pattern Directory was first launched, it needed a way for people to create and submit patterns. The design for the creation UI was very custom, so at the time, it made sense to build a custom editor. Even then, this was complicated and required using private and experimental APIs. As Gutenberg continued to iterate, it became harder to keep up with what changed, especially with no dev dedicated to this.

There are currently 25 issues open for the pattern creator alone, mostly due to the way the creator is initialized and loaded (for example, it’s loading the site’s theme, rather than Twenty Twenty-Three like the previews).

I think the custom pattern creator editor should be removed, and instead, allow users to edit the wporg-pattern post type in the core (post) editor1. The editor’s sidebar can be updated for this post type to include all the same settings, and remove the ones that don’t apply. The openverse modal integration should port over easily since it’s designed to work with core blocks. The submission panel could likely be converted into a pre-publish panel.

This PR starts off by removing the pattern creator plugin2, and moving the code here into the pattern-directory plugin, where there is already code to update the post-type editor UI for moderation. I've moved over the back button, media handling, & pattern details UI.

Still to do:

  • Submission flow (pre-publish panel)
    • Most of the content required is in the sidebar, so maybe we only need the guidelines confirmation here
  • On submission:
    • Ensure the validation runs, a changed pattern is flipped to pending. Currently fails, as pattern attempts to publish.
    • Prevent the “upload external image” flow
    • Prevent other entity updates (navigation menus, templates, etc)
  • Replace image flow
    • Can reset and open gallery again
    • Cover block, can’t reset/open.
  • Maybe try to update the “external image” modal when inserting media from sidebar?
  • Disable "Show template" view
  • Need to add locale meta
  • Fix up deprecated PluginDocumentSettingPanel, update controls props, find other deprecated/unstable/experimental components
  • What about moderators who are pattern creators?
    • Currently these are two separate UIs, the post-type editor for moderation and the creator for users
    • In this PR, what you see is based on user role, but a moderator creating a pattern will see moderation tools on the new pattern.
  • Ensure internal categories, keywords are not revealed
  • Fix whatever is going on with the sidebar on sandbox

Screenshots

Currently on my local site this works great, but it's showing more info to my user on a sandbox.

Regular user Moderator view
Current Screen Shot 2024-12-18 at 18 00 16 Screen Shot 2024-12-18 at 18 01 49
PR Screen Shot 2024-12-18 at 17 46 44 Screen Shot 2024-12-18 at 17 46 06

The most awkward wp-admin sidebar, when I switch to a regular user on my sandbox.

Screenshot 2024-12-18 at 5 29 38 PM

Footnotes

  1. This will not use the pattern editor, because these are not “patterns” on the current site. Regular users will not have permissions for anything in the Site Editor UI.

  2. This should actually be reverted, I think we'll want to merge the improvements to the pattern editor to allow for testing, before fully removing the creator.

ryelle added 7 commits July 18, 2025 10:21
# Conflicts:
#	public_html/wp-content/plugins/pattern-creator/pattern-creator.php
#	public_html/wp-content/plugins/pattern-creator/webpack.config.js
This forces the Pattern Directory placeholder as the default for all media blocks, which correctly flags which blocks are supported and which are not.
@ryelle ryelle force-pushed the try/core-editor-for-patterns branch from e8e2301 to bee1dac Compare July 18, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Component] Pattern Creator Anything related to the pattern front end editor or preview

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants