-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Inserter: Always show the list of all patterns in the inserter #65611
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Size Change: +401 B (+0.02%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
Let's watch for performance degradation here. The pattern parsing is expensive, and we already have reports related to the Inserter + Patterns - #64732. |
This should actually make things more performance, because the pattern parsing is only done on the callback to insert. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before
CleanShot.2024-09-24.at.11.27.28.mp4
After
CleanShot.2024-09-24.at.11.28.07.mp4
Much nicer ❤️ |
Related #60021
Follow-up to #65490
Similar to #62169 but for patterns
What?
In #62169 we updated the block inserter to show the full block list in the inserter regardless of whether we are allowed or not to insert the block in a given position.
The current PR does the same for patterns. So all patterns are always shown in the inserter but only when you click a pattern, we compute the insertion point for the pattern and insert into the closest available position.
This behavior is very important for the new "select mode" where users will keep adding patterns and selecting sections.
Testing Instructions
1- Add a group with some paragraphs within it
2- Switch to "edit mode" (or select mode)
3- Notice the patterns inserter always shows the full list of patterns regardless of whether a content block is selected or a section.
4- Notice that it always insert after the current section.