-
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
Add design tool pattern to the 'Advanced' tab in block inspector #45287
Comments
Could this not work without the help-text? I.e. just like a plain toolspanel? One challenge is that some other blocks like Navigation put additional items there, like menu management. Something to consider. |
There are a couple of plugins that seem to use this area too (though it is an experimental API) - https://www.wpdirectory.net/search/01GGVGDDHBTHFK7NWQCP8F0CQX In these cases we won't know what the tool is, so it'll be difficult to display it in the dropdown menu as anything but 'other'. Given it's such small usage it may be possible to reach out to the plugin devs and ask them to update to whatever API is introduced. Another observation is that it'd be good to see how well this revised UI works in the tabs being trialed in #45005. |
@talldan Just want to flag here that whilst the So the advanced inspector controls area is a stable slot that will need to get preserved/migrated. You can view the search for the component here: |
Cool, thanks for flagging that. I thought there was a stable slot, but had trouble finding it in the codebase. Definitely something to consider then in terms of the design - there's going to be a lot more plugin usage than I mentioned before, and in terms of this feature we won't know what those controls are. There would also only be the possibility of showing or hiding them as one item in the dropdown. It might be a sensitive area for plugin developers. |
Would it be possible to move the slot to become an item inside the toolspanel? If not, it doesn't seem world-ending to have the plugin-added items sit there permanently. |
Yep, that would be possible I think. It would be a catch-all, every 'unknown' tool under one item in the tools panel if that makes sense. |
Having very limited understanding of the API in question, my hope was that the call to add an item there could be a call to add individual menu items in the tools panel instead. But a catch-all might work. |
One thing that might help here is, that the Because of this, it may be technically possible to automatically transform each of the slots into a tool panel. But it will likely still be difficult since the tool panel needs to know which value to use for whether or not the value inside the panel has been set and therefore whether it should be expanded or now. We just don't have any means of knowing this about custom extensions using the slot. |
As @fabiankaegy notes, the ToolsPanel expects to be given callbacks to determine whether a ToolsPanelItem has a value or not, reset that value, and reset appropriate values when "reset all" is called. The ToolsPanel can however render any non- |
I think the custom items provided by plugins also wouldn't have a name or label, so that would make it difficult to display them in the dropdown. |
It would be great to use the mechanism @aaronrobertshaw mentioned to just display them there. But also I would love there to be a new API to actually adapt the Panels approach. That way plugin authors can migrate to the new approach and match the core UI paradigm. |
The 'Advanced' panel in the block inspector is getting a little crowded, and will become moreso when we close #44412.
Since the items in this panel are largely situational, it might be worth applying the 'design tool' pattern, enabling folks to add/remove controls ad hoc:
The text was updated successfully, but these errors were encountered: