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

Creating a better Developer experience for creating UIs inside PluginSidebar slotfill. #64272

Closed
ryanwelcher opened this issue Aug 5, 2024 · 0 comments
Assignees
Labels
Developer Experience Ideas about improving block and theme developer experience [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.

Comments

@ryanwelcher
Copy link
Contributor

ryanwelcher commented Aug 5, 2024

What problem does this address?

When creating a new PluginSidebar, the default UI experience is not ideal.

Any items inside the panel are pushed right up against the edges:

Cursor_and_Edit_Post_“BlockEditChildren”_‹Gutenberg-works—WordPress_and_index_js—gutenberg-no-upstream2__Workspace

To address this, the contents need to be wrapped in a <PanelBody> component. This adds some unnecessary friction and boilerplate and is overall a frustating experience especially for developers who are just getting started.

What is your proposed solution?

I propose that we add a new prop to the PluginSidebar component called wrapContents that would default to false to allow for backwards compatibility for current implements.

When passed, the contents of the fill will be automatically wrapped in a <PanelBody> component. This is a much better DevEx for those looking to just have the panel contents render nicely while also allowing for much more control over the UI leaving value false and building out the UI manually.

This approach could also be applied to other slots as well.

@ryanwelcher ryanwelcher added [Type] Enhancement A suggestion for improvement. [Package] Editor /packages/editor Developer Experience Ideas about improving block and theme developer experience labels Aug 5, 2024
@ryanwelcher ryanwelcher self-assigned this Aug 5, 2024
@ryanwelcher ryanwelcher changed the title Creating a better Developer experience for creating UIs inside PluginSidebar slotfil. Creating a better Developer experience for creating UIs inside PluginSidebar slotfill. Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Package] Editor /packages/editor [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

1 participant