-
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
Implement Tabs in widget editor settings #57886
Conversation
Size Change: -463 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
34cf770
to
db90c78
Compare
After some testing and looking more closely at the logic controlling which tab panel is displayed, I don't think this sidebar is going to subject to the race condition we saw in the editor. I've added code comment mentioned in the last round of feedback, and once CI passes I think this one should be good to go. |
</Button> | ||
<Tabs.Context.Provider value={ tabsContextValue }> | ||
<Tabs.TabPanel tabId={ WIDGET_AREAS_IDENTIFIER }> | ||
<WidgetAreas |
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.
Noting that, compared to the previous code, the contents of the tab panels are now wrapped inside an additional div
. At a quick glance, I didn't notice any side effects, though.
7bce5f2
to
9ac172b
Compare
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core SVNIf you're a Core Committer, use this list when committing to
GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Thanks @ciampo! Open feedback should all be addressed! |
9ac172b
to
2d375e3
Compare
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.
🚀
What?
Replace existing list-based tabs the new
Tabs
component in the site widget settings sidebarWhy?
The current implementation was necessary because our legacy
TabPanel
component was not granular enough to be applied in this sidebar, due in large part to the internals of the theComplementaryArea
the sidebar uses.How?
Using the new, more granular sub-components of
Tabs
, we can render the appropriate parts of the UI viaComplementaryArea
'sslot
/fill
, and pass theTabs
context to those components as needed.This implementation is very similar to the one used previously in #55360.
Testing Instructions
Note: to test smaller/mobile viewports, make sure your viewport is at least 600px in width. Because it's technically a pinned item, this sidebar is intentionally disabled on smaller screens.
Testing Instructions for Keyboard
tablist
and focuses the next element instead (the close button)