-
Notifications
You must be signed in to change notification settings - Fork 812
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
Likes and sharing panel: Render on demand #12052
Likes and sharing panel: Render on demand #12052
Conversation
2271fac
to
63d3865
Compare
This is an automated check which relies on |
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.
Code looks good and this tests well and identically to #12045 (review)
Earlier behaviour wasn't hiding this only from pages, but also for non-public custom post types such as re-usable blocks where this probably shouldn't show up anyway. tThat's outside this refactoring and a separate bug and not stopping this from being merged.
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.
Well done! A call to registerPlugin
for the Likes and Sharing panel was what my prior implementation was missing. Thanks for fixing that!
i'll apply manually to .com |
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.
this works well on my end 👍
This should be good to merged, but I'm blocked by the |
Caution: This PR has changes that must be merged to WordPress.com |
@sirreal Should be good now. D26942-code is the matching WordPress.com diff. |
THANK YOU @sirreal @roccotripaldi @simison @jeherve for moving so fast on this one 🎉 Best way to start a Monday! |
Likes and sharing are two independent plugins that render checkboxes in the same panel of the Jetpack sidebar.
There is an issue where the absence of other, unrelated sidebar panels causes the entire sidebar to be hidden, unintentionally hiding likes and sharing options:
jetpack/extensions/shared/jetpack-plugin-sidebar.js
Lines 23 to 37 in 08a66d7
The likes and sharing panel becomes another plugin, very similar to the Jetpack sidebar. This allows slot/fill to work correctly at all the levels. It is an independent plugin so that it can register (render) the slot 1 time while being used by 0 or more independent plugins to cause the panel to render 0 or 1 times as necessary.
The panel is also a true fill of the Jetpack sidebar, fixing the initial problem where it was a sibling of the fills. The sidebar is not rendered if there are no fills, which is why the sibling approach was a problem. As a true fill, the existing mechanism to show/hide the sidebar remains untouched.
This PR also includes some Janitorial work around the existing sidebar and the slot/fills:
FillComponent.Slot
. These slots are not intended to be rendered outside of these components, do not export them.Testing instructions (from #12045):
Supersedes: