-
Notifications
You must be signed in to change notification settings - Fork 844
Social: Add resharing and scheduling to the unified modal #46279
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
Social: Add resharing and scheduling to the unified modal #46279
Conversation
Introduces a custom hook to provide footer actions for the social post preview modal, conditionally rendering schedule, share, or save buttons based on post status and feature availability.
|
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! |
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.
Pull request overview
This PR implements resharing and scheduling functionality within the unified modal for Jetpack Social. When viewing a published post, users can now schedule or immediately share posts to social media directly from the unified preview modal. The implementation decouples the Share and Schedule button components to make them self-contained and reusable, while enhancing the NavigatorModal component to support dynamic footer actions that can programmatically control modal closure.
Key Changes:
- Enhanced NavigatorModal footer to support both static button props and dynamic render functions that receive a
navigatecallback for programmatic modal control - Created a new
useFooterActionshook that conditionally returns appropriate footer buttons based on post publication status and feature availability - Refactored ScheduleButton and SharePostButton to be self-contained components that manage their own state and business logic internally
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
projects/js-packages/components/components/navigator-modal/footer.tsx |
Enhanced footer to support both static button props and function-based actions with navigate callback |
projects/js-packages/components/components/navigator-modal/stories/index.stories.tsx |
Updated storybook examples to demonstrate new function-based footer actions pattern |
projects/js-packages/publicize-components/src/components/schedule-button/index.tsx |
Refactored to be self-contained component managing its own state, removing external prop configuration |
projects/js-packages/publicize-components/src/components/share-post/index.jsx |
Updated to manage disabled state internally and added send icon |
projects/js-packages/publicize-components/src/components/social-post-modal/settings-section.tsx |
Simplified by removing redundant state management now handled by button components |
projects/js-packages/publicize-components/src/components/unified-modal/social-post-preview/use-footer-actions.tsx |
New hook providing conditional footer actions based on post status and republishing feature availability |
projects/js-packages/publicize-components/src/components/unified-modal/social-post-preview/use-modal-screen.tsx |
Updated to use dynamic footer actions and conditional modal title based on post publication status |
projects/js-packages/publicize-components/changelog/update-social-add-resharing-to-unified-modal |
Changelog entry for publicize-components package |
projects/js-packages/components/changelog/update-social-add-resharing-to-unified-modal |
Changelog entry for components package |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
projects/js-packages/publicize-components/src/components/schedule-button/index.tsx
Show resolved
Hide resolved
projects/js-packages/publicize-components/src/components/schedule-button/index.tsx
Outdated
Show resolved
Hide resolved
...publicize-components/src/components/unified-modal/social-post-preview/use-footer-actions.tsx
Show resolved
Hide resolved
Code Coverage SummaryCoverage changed in 5 files.
2 files are newly checked for coverage.
Full summary · PHP report · JS report Coverage check overridden by
Coverage tests to be added later
|
gmjuhasz
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.
This looks and works good overall! I noticed that when scheduling/resharing, there is a second between saving/sharing, when the buttons become active again. Maybe we could wait for both to complete before reenabling the actions?
CleanShot.2025-12-15.at.13.14.35.mp4
Not for this PR, but also wondering if we should increase the height of the modal to be taller fitting more content without scrlloing.
Thank you for catching that. It's the same on trunk. Screen.Recording.2025-12-15.at.6.52.19.PM.movMay be we can fix it as a separate PR?
Totally agree on that |
gmjuhasz
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.
This works well, I could reshare, and it worked as trunk
Completes SOCIAL-245
Proposed changes:
This PR adds resharing functionality to the unified modal for Jetpack Social. When viewing a published post, users can now schedule or share posts to social media from the unified preview modal.
Core Changes
1. Dynamic Footer Actions in NavigatorModal (components/navigator-modal/footer.tsx)
navigatecallback2. Decoupled Share and Schedule Buttons
This makes them more reusable and easier to integrate into different contexts (like the unified modal footer).
ScheduleButton (components/schedule-button/index.tsx):
isBusy,isDisabled,onChange,onConfirm)SharePostButton (components/share-post/index.jsx):
3. Conditional Footer Actions Hook (unified-modal/social-post-preview/use-footer-actions.tsx)
navigatecallback4. Updated Modal Screen Configuration (unified-modal/social-post-preview/use-modal-screen.tsx)
5. Simplified Settings Section (social-post-modal/settings-section.tsx)
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Testing Instructions:
Test Case 1: Resharing buttons appear for published posts
Test Case 2: Save Changes button appears for draft posts
Test Case 3: Schedule button functionality
Test Case 4: Share button functionality