-
Notifications
You must be signed in to change notification settings - Fork 842
Social: Add the new media selection UI #46085
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
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! Jetpack plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. Social plugin: No scheduled milestone found for this plugin. If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
Code Coverage SummaryCoverage changed in 2 files.
5 files are newly checked for coverage.
|
bfa083a to
6df34c2
Compare
grzegorz-cp
left a comment
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.
Works well and the feature flag is respected.
To improve the PR, we could extract the colour hex to a variable in the SCSS file or use defined colours. We can also reconsider the file name from "new" to a version number e.g. - media-selection-v2, but it's not a big deal.
Thank you for breaking the work up into smaller PRs.
|
I noticed that when a post doesn't have a featured image and you click "Featured image" in the dropdown nothing happens. We can improve this by adding a warning message or by disabling the option. I would be great if at some point in the future, we could add a help popover that would explain all options available in the whole "Share to social media" sidebar. Currently using SIG is like a trial and error if you don't know what it does. |
|
@grzegorz-cp I refactored the change a bit I found a better way to handle the logic. I also added the extra toggles here, as with this approach it made more sense rather than creating a new PR just for that. |
grzegorz-cp
left a comment
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.
Great, thanks for making the changes.

Fixes https://linear.app/a8c/issue/SOCIAL-237/image-ui-create-the-image-view-ui-along-with-the-buttons
Sits on top of #46100Proposed changes:
Adds a new unified media selection UI for social posts with the following features:
New
NewMediaSectioncomponentSupporting components
MediaSourceMenu: Dropdown component for selecting media sourcesMediaPreview: Preview component with action buttons for images and videosHook improvements
updateJetpackSocialOptionsinusePostMetato support batch updates, preventing race conditions when updating multiple options simultaneously (e.g., clearing attached media while toggling SIG)Testing instructions:
Quickly check that with this PR and without the feature flag, you still see the old UI and it works as before.
Add the feature flag to your site: Run
wpsh > add_blog_sticker( 'jetpack-social-unified-ui-v1', null, null, <your-blog-id> );NOTE: Video upload is not hooked up currently
Source types
Dropdown
Overlay menu
Edit template button
Other information:
Does this pull request change what data or activity we track or use?
Yes - adds analytics events:
jetpack_social_media_source_changed- when user switches media sourcejetpack_social_media_removed- when user removes media