-
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
Add new hook to allow additional featured block #39816
base: trunk
Are you sure you want to change the base?
Add new hook to allow additional featured block #39816
Conversation
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.
Thank you for the PR. Code wise this looks good.
My only concern is how much this opens up the UI to being overwhelmed with multiple featured blocks.
Imagine if several Plugins you have installed insert blocks into this featured area. Suddenly it's going to become overwhelming very quickly.
In the linked Issue you say:
It's not possible for a third party plugin to feature a custom block for navigation. There is still a workaround by adding a random link and transforming it into another kind of block. But from a user point of view it is not convenient at all.
I wonder is there an alternative solution we could look at? Perhaps we need to look at opening up the Nav block to other types of blocks from the inserter?
I appreciate this probably seems like I'm blocking a perfectly reasonable filter, but it's really important that we keep the UIs streamlined.
Looking forward to hearing your thoughts.
Thanks for working on this. I agree with @getdave about opening it up to an arbitrary number of blocks. The design starts to look wrong with four. A filter could probably still support only three by disregarding anything after the third item as long as that's clearly documented. Another option for deciding which three blocks to show could be to use the Anyway, I think the core issue here is that it's still really quite hard to insert non-link blocks. I don't think #34041 was ever solved completely. It's now easy to insert a Link, not too difficult to insert a Search, Site Logo, or Social Icons, but very confusing to insert anything else. |
@talldan, I liked the idea of the variation approach you mentioned here - #36026 (comment). Maybe we can introduce a new variation scope ( I agreed that the design would need to adjust. |
Thank you all for your feedback 😃 @getdave I understand your concerns about having too many blocks displayed in the transform control panel. The idea of handling the displayed blocks through a priority seems to be easily implemented but everyone will require the first place in their code (that's what I'd do 😅 ). And the rendering won't be predictable by potentially hiding some custom blocks (which we want to avoid). But maybe I misunderstood your point. As for the variation approach, I must say I'm not really qualified about this way of doing (newbie here ahah). So I won't dare to propose something. |
While the filter should be considered in the context of @talldan 's point that the design is not really "extensible" yet, I also don't think this particular solution solves #39814. The idea is for the user to be able to insert that language switcher. Should plugins be allowed to turn off the default behaviour of inserting links, and have the inserter open instead? |
@draganescu You're right, the proposed solution is only a workaround. From a user point of view, the easiest way would be to insert the plugin's block directly (and not transform a link into something else). |
Hi 👋 |
@Hug0-Drelon I added design related labels, but what seems from reading above to be the blocker is to figure out how the UX for solving what @talldan described as
Bringing this PR and its associated issue up in design channels in core is also a good start. Briefly, it's not the code that is the major problem but the interaction. |
Fixes #39814
What?
Introduce a new filter to allow adding blocks in the navigation transform control panel.
Why?
This could be useful for third party plugins to feature their custom blocks and for the user to use it easily.
Testing Instructions
This PR can be manually tested after creating and registering a custom block and adding something like:
Your custom block feature should be displayed here: