-
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
Add customize widgets inserter #29549
Conversation
Size Change: +2.18 kB (0%) Total Size: 1.42 MB
ℹ️ View Unchanged
|
c02051e
to
21fae3c
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.
Really nice work here! It's looking fantastic.
I noticed three bugs while testing:
-
In Firefox on macOS, the Quick Inserter appears underneath the Customizer's scroll bar.
-
When you open the Customizer's publish options, the inserter does not close.
Kapture.2021-03-15.at.14.26.53.mp4
-
When you navigate away from Widgets, the inserter does not close.
Kapture.2021-03-15.at.14.29.37.mp4
I'd also like to explore if we can re-use the Customizer's outer-section-open
instead of re-implementing our own slide out and fade animation.
This is not the behaviour for the existing slide-out panel that the Customizer has, so I say no. |
I think we should try and match the behavior of the other panes that hide/appear when using the Customizer, like the publish options or the menu's inserter. Looking at the existing panes they...
My instinct tells me that we should allow for clicking the scrim to close the pane, but I don't think we should venture down that road unless we're willing to add/change the behavior everywhere else in the Customizer. Similarly, I'd expect the color of the scrim and the transition timing function to match the existing Customizer panes. -- One thing that stood out to me was that |
02c7926
to
b9da7c8
Compare
packages/customize-widgets/src/components/inserter/use-inserter.js
Outdated
Show resolved
Hide resolved
packages/customize-widgets/src/components/inserter/use-inserter.js
Outdated
Show resolved
Hide resolved
Amazing work! I'm honestly impressed at how smooth you've gotten this working. It all works really well when I run it locally. Instead of having So, instead of having a class SidebarControl extends customize.Control {
...
render() {
if ( this.expanded() ) {
render(
<SidebarBlockEditor
sidebar={ new SidebarAdapter( this.setting, customize ) }
openInserter={ this.openInserter.bind( this ) }
closeInserter={ this.closeInserter.bind( this ) }
/>,
this.container[ 0 ]
);
} else {
...
}
}
openInserter() {
// insert stateful Backbone & DOM stuff here
}
closeInserter() {
// insert stateful Backbone & DOM stuff here
}
} I think this may be simpler to understand and might make it easier to merge these changes into Core. What do you think? |
@noisysocks That's a great suggestion! However, I think we would eventually need to access the state in React anyway. There's already |
Ah, right, I suppose you could pass down an object which has We could even use an I think that there's value in trying to keep these two different ways of building applications (Backbone / React) from mixing with each other and then, where it is necessary for them to mix, using explicit interfaces (like |
packages/customize-widgets/src/components/inserter/inserter-outer-section.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Robert Anderson <robert@noisysocks.com>
4e0abae
to
38a8fd1
Compare
Description
Close #29285.
Known issues
Clicking on the backdrop of the inserter won't close it (should it?)(it shouldn't)How has this been tested?
Screenshots
Kapture.2021-03-23.at.01.58.14.mp4
Types of changes
New feature
Checklist: