WordPress / WordPress/pattern-directory
Pattern Creator: pattern previews are misleading due to lack of full width and layout features in the post editor
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 134
- Forks
- 46
- Avg merge
- 9h 4m
- Merged PRs (30d)
- 19
Description
Related to https://github.com/WordPress/pattern-directory/issues/628
Describe the bug
When creating a pattern using the Pattern Directory editor (aka pattern creator) in the directory, contributors can get confused by the editor preview because the directory uses the post editor, which lacks support for:
- Full width
The width is limited by the theme'scontentWidth(680px) on the preview. This seems expected because the directory uses the Post editor to create patterns. - Layout toggle
This toggle to switch between flow and constrained layout does not work on the preview.
To Reproduce
Steps to reproduce the behavior:
- Go to https://wordpress.org/patterns/new-pattern/ to contribute to the directory creating patterns
- Add a gallery of images and expect to see the columns borked on the preview.
- Add a group with an image in it, use the Layout toggle, and expect to see no effect on the preview.
- Rather than design your pattern directly in the Pattern Directory editor, go to the Site editor of one of your sites, design a full-width pattern, then copy-paste it into the Pattern Directory editor to submit a pattern to the directory, and expect to see your pattern borked because the
max-widthof the editor preview is680px.
Expected behavior
Pattern previews in the Pattern Directory editor should look like pattern previews in the Pattern Directory.
Screenshots
See in the following screenshots how patterns look as expected in the Site Editor and the Pattern Details of the Pattern Directory but look borked in the Pattern Directory editor.
| Pattern Directory Editor | Pattern Details | Site Editor |
|---|---|---|
| Pattern Directory Editor | Pattern Details | Site Editor |
|---|---|---|
Please look at the following recording of how the Layout toggle doesn't work.
| Pattern Directory Editor | Site Editor |
|---|---|
Additional context
Submitting a pattern confuses contributors because of the misleading editor preview. As a workaround, we use the Site editor in our sites to design patterns and then copy-paste them into the Pattern Directory editor to submit them.
Ideally, patterns should be created from the Site editor because that is the pattern creation flow contributors have been using since WordPress 6.3 to create custom patterns. As a reference: https://learn.wordpress.org/tutorial/creating-your-own-custom-synced-or-non-synced-patterns/
I'd like to help to improve this experience. cc: @annezazu @richtabor @ryelle Any ideas?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Pattern Creator entry point in public_html/wp-content/plugins/pattern-creator/pattern-creator.php and the 680px contentWidth setting in public_html/wp-content/themes/wporg-pattern-directory-2024/theme.json. Follow the reproduction steps and compare the editor with Pattern Details and the Site Editor. Done means full-width patterns and the flow/constrained Layout toggle preview consistently with the directory.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100