Pattern Creator: Try core editor #719
Draft
+565
−9,295
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Screenshots
Currently on my local site this works great, but it's showing more info to my user on a sandbox.
The most awkward wp-admin sidebar, when I switch to a regular user on my sandbox.
Footnotes
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. ↩
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. ↩