-
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
Sidebar: Only render sidebar tabs possessing items to display #45991
Conversation
If there is only a single tab with items to display, no tabs will be rendered. Instead, we'll render the tab's items directly to the sidebar.
Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
Size Change: -87 B (0%) Total Size: 1.31 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.
Worked as advertised for me:
✅ With the experiment turned off inspector worked as it currently does
✅ With it turned on controls were correctly split between tabs, and tabs only showed if the contained items, eg. List view only showed for Navigation block
Related:
What?
Reintroduces the original approach in #45005 which only renders a tab when it contains items. If only one tab has items, those items are rendered directly to the sidebar i.e. no tab list is rendered.
Why?
This behaviour was removed from the original addition of tabs to increase consistency across blocks. Further explorations have shown this to have limited upside while severely restricting the benefits of tabs. Most blocks will already have consistent tabs (i.e. both settings and appearance tabs).
While tabs in the block inspector are a Gutenberg experiment, we can lean into them and the original design, seeking widespread concrete feedback, particularly around a11y.
How?
Testing Instructions
Example block code
Screenshots or screencast
Screen.Recording.2022-11-23.at.5.41.49.pm.mp4