Skip to content
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

filterable groups in InspectorControl #67053

Open
Lovor01 opened this issue Nov 17, 2024 · 3 comments
Open

filterable groups in InspectorControl #67053

Lovor01 opened this issue Nov 17, 2024 · 3 comments
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Enhancement A suggestion for improvement.

Comments

@Lovor01
Copy link
Contributor

Lovor01 commented Nov 17, 2024

Filterable groups

Groups defined in packages/block-editor/src/components/inspector-controls/groups.js should be filterable to allow developers adding their extensions (groups) to block sidebar.

@Lovor01 Lovor01 added the [Type] Enhancement A suggestion for improvement. label Nov 17, 2024
@talldan talldan added the [Status] Needs More Info Follow-up required in order to be actionable. label Nov 18, 2024
@talldan
Copy link
Contributor

talldan commented Nov 18, 2024

This issue is a bit sparse, ideally there are some use cases and other details for this kind of extensibility request.

@Lovor01
Copy link
Contributor Author

Lovor01 commented Nov 23, 2024

I agree this is a sparse issue, but I will try to elaborate. If proposition #59115 to add new tabs will be accepted, then mechanism to add groups inside will be needed. Further, it is possible for block author to have needs for another group which still doesn't fit into existing ones. Even core groups which were defined in WP6.2 are now extended with more groups, which means that new groups are neccessary with time. For example, I might need to have somewhere a place for entering configuration JSON, which controls configuration of slider which I am using for a block. Since JSON is long, the best place would be new tab and new group inside this tab. Having this new group will not only have a purpose of better organisation, but provide a way for other extenders to extend my block and add something to this group by using familiar interface:

<InspectorControls group="newgroup">
...
</ InspectorControls>

@talldan
Copy link
Contributor

talldan commented Nov 25, 2024

If proposition #59115 to add new tabs will be accepted, then mechanism to add groups inside will be needed.

If #59115 were solved then there would need to be a way to render stuff in the tab, so that seems like an implicit part of that issue.

Your other mention of a JSON control is still relevant to #59115 since you mention it being in a new tab.

I think I'd suggest adding the requirement of new inspector control groups for the tabs to that issue.

Outside of that, I'm not sure a valid use case for the filterable groups has been described.

Even core groups which were defined in WP6.2 are now extended with more groups, which means that new groups are neccessary with time.

The groups are the extensibility mechanism, and more groups were added to allow core features and plugins to render controls in more places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Needs More Info Follow-up required in order to be actionable. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants