-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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: Hide child blocks from the inserter when needed #67734
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: -96 B (-0.01%) Total Size: 1.83 MB
ℹ️ View Unchanged
|
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.
This is testing well for me, thank you! I noticed that it caused confusion during the speed build challenge last Friday and came to see if there was an issue for it.
Screen.Recording.2024-12-09.at.14.43.01.mov
Thanks, Riad! This almost works, but some bugs remain for the primary root (
Screenshot, group block example |
It looks like the diff --git packages/block-editor/src/store/selectors.js packages/block-editor/src/store/selectors.js
index 8e2ce92eede..7ee0efd5f41 100644
--- packages/block-editor/src/store/selectors.js
+++ packages/block-editor/src/store/selectors.js
@@ -2061,6 +2061,7 @@ const buildBlockTypeItem =
return {
...blockItemBase,
initialAttributes: {},
+ ancestor: blockType.ancestor,
description: blockType.description,
category: blockType.category,
keywords: blockType.keywords, |
I think the "template parts" and "post content" blocks showing there are issues unrelated with the current PR. I'm not entirely sure how to solve this yet. |
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.
I think the "template parts" and "post content" blocks showing there are issues unrelated with the current PR. I'm not entirely sure how to solve this yet.
We can tackle that separately. Can you create an issue so we don't forget?
I created an issue here #67797 |
…67734) Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: juanfra <juanfra@git.wordpress.org> Co-authored-by: annezazu <annezazu@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
closes #65687
What?
In a previous iteration, we allowed all blocks to be visible in the inserter at any time. This has proven a bit confusing for blocks that require a parent block. These blocks should only be visible within their parent blocks. This PR solves that.
Testing Instructions
1- The "column" block shouldn't be visible when you're at the root level in the inserter
2- The "column" block should be visible when you're within a columns block.