Sidebar: Only render sidebar tabs possessing items to display#45991
Merged
aaronrobertshaw merged 1 commit intotrunkfrom Nov 25, 2022
Merged
Sidebar: Only render sidebar tabs possessing items to display#45991aaronrobertshaw merged 1 commit intotrunkfrom
aaronrobertshaw merged 1 commit intotrunkfrom
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.
|
|
|
Size Change: -87 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
This was referenced Nov 23, 2022
glendaviesnz
approved these changes
Nov 25, 2022
Contributor
glendaviesnz
left a comment
There was a problem hiding this comment.
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
This was referenced Mar 3, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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