Skip to content

Conversation

@manzoorwanijk
Copy link
Member

@manzoorwanijk manzoorwanijk commented Nov 26, 2025

Completes SOCIAL-242

Proposed changes:

  • Wires up the unified modal to render the Social post preview.
  • It currently renderes only the accounts list in the modal
  • It also renders the dummy button for edit template modal for demonstration purposes. Extracted to Social: Add edit template modal #46120

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

Does this pull request change what data or activity we track or use?

Testing instructions:

  • Add the feature flag to your blog: Run wpsh > add_blog_sticker( 'jetpack-social-unified-ui-v1', null, null, <your-blog-id> );
  • Go to the editor
  • Open Jetpack sidebar
  • Open the preview social posts modal
  • Confirm that the accounts list is rendered as expected
  • Toggle the accounts ON/OFF
  • Confirm that it works as expected
Screen.Recording.2025-11-26.at.5.45.49.PM.mov

@manzoorwanijk manzoorwanijk requested a review from a team November 26, 2025 12:21
@manzoorwanijk manzoorwanijk self-assigned this Nov 26, 2025
@manzoorwanijk manzoorwanijk added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Team Review Obsolete. Use Needs Review instead. labels Nov 26, 2025
@github-actions
Copy link
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the add/social/unified-modal branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack add/social/unified-modal
bin/jetpack-downloader test jetpack-mu-wpcom-plugin add/social/unified-modal

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copilot finished reviewing on behalf of manzoorwanijk November 26, 2025 12:27
@manzoorwanijk manzoorwanijk force-pushed the add/social/unified-modal branch from 7537767 to 9c5ebc9 Compare November 26, 2025 12:28
Copy link
Contributor

Copilot AI left a 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 integrates a unified modal for social post preview and editing capabilities, introducing a centralized navigation-based modal system powered by Redux state management. The modal supports multiple screens (social post preview and template editing) with configurable navigation and screen locking capabilities.

Key changes:

  • Added Redux store state management for unified modal (actions, selectors, reducers)
  • Created NavigatorModal-based UI with social post preview and edit template screens
  • Refactored ConnectionsToggleList to support flexible interaction patterns (item click vs toggle click)

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 23 comments.

Show a summary per file
File Description
src/social-store/types.ts Added UnifiedModalState type for modal state management
src/social-store/actions/unified-modal.ts Created actions for opening/closing modal and managing navigation state
src/social-store/actions/constants.ts Added action type constants for unified modal
src/social-store/selectors/unified-modal.ts Added selectors to retrieve modal state (open status, path, screen lock)
src/social-store/reducer/unified-modal.ts Implemented reducer for unified modal state updates
src/components/unified-modal/index.tsx Main modal component integrating NavigatorModal with Redux store
src/components/unified-modal/social-post-preview/use-modal-screen.tsx Hook providing screen configuration for social post preview
src/components/unified-modal/social-post-preview/sidebar.tsx Sidebar with account list and customization options
src/components/unified-modal/social-post-preview/content.tsx Content area displaying post preview for selected connection
src/components/unified-modal/edit-template/use-modal-screen.tsx Hook providing screen configuration for template editor
src/components/unified-modal/edit-template/sidebar.tsx Sidebar with template editing controls (font selector)
src/components/unified-modal/edit-template/content.tsx Content area displaying generated image preview
src/components/unified-modal/edit-template/types.ts TypeScript types for template editor local state
src/components/unified-modal/edit-template/utils.ts Utility function for determining image type
src/components/connections-toggle-list/index.tsx Refactored to support customizable click handlers and styling
src/components/form/connections-list.tsx Updated to use new ConnectionsToggleList API with click handlers
src/components/form/preview-posts-trigger.tsx Button component to open unified modal for post preview
src/components/social-image-generator/panel/edit-template.tsx Button to open modal for template editing
src/components/global-modals/index.tsx Integrated UnifiedModal into global modals renderer
src/components/form/styles.module.scss Added styles for connections list and preview trigger button
src/components/connections-toggle-list/styles.module.scss Moved border/margin styles to parent component
changelog/add-social-unified-modal Added changelog entry for unified modal feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@jp-launch-control
Copy link

jp-launch-control bot commented Nov 26, 2025

Code Coverage Summary

Coverage changed in 3 files.

File Coverage Δ% Δ Uncovered
projects/js-packages/publicize-components/src/components/form/connections-list.tsx 0/10 (0.00%) 0.00% 5 💔
projects/js-packages/publicize-components/src/components/connections-toggle-list/index.tsx 0/14 (0.00%) 0.00% 3 ❤️‍🩹
projects/js-packages/publicize-components/src/social-store/actions/constants.ts 22/22 (100.00%) 0.00% 0 💚

9 files are newly checked for coverage. Only the first 5 are listed here.

File Coverage
projects/js-packages/publicize-components/src/components/form/preview-posts-trigger.tsx 0/13 (0.00%) 💔
projects/js-packages/publicize-components/src/components/unified-modal/index.tsx 0/10 (0.00%) 💔
projects/js-packages/publicize-components/src/components/unified-modal/social-post-preview/content.tsx 0/1 (0.00%) 💔
projects/js-packages/publicize-components/src/components/unified-modal/social-post-preview/sidebar.tsx 0/8 (0.00%) 💔
projects/js-packages/publicize-components/src/components/unified-modal/social-post-preview/use-modal-screen.tsx 0/4 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR .

@robertsreberski
Copy link
Contributor

It also renders the dummy button for edit template modal for demonstration purposes.

You can create a draft PR with the dummy button. It would be preferable not to merge the code for presentation purposes into trunk

@manzoorwanijk
Copy link
Member Author

You can create a draft PR with the dummy button. It would be preferable not to merge the code for presentation purposes into trunk

It’s behind a feature flag.

@manzoorwanijk manzoorwanijk force-pushed the add/social/unified-modal branch from 1e4bfad to fd288bc Compare November 27, 2025 04:31
Base automatically changed from add/unified-modal to trunk November 27, 2025 04:56
@manzoorwanijk manzoorwanijk force-pushed the add/social/unified-modal branch from fd288bc to 845233e Compare November 27, 2025 04:58
@manzoorwanijk
Copy link
Member Author

You can create a draft PR with the dummy button. It would be preferable not to merge the code for presentation purposes into trunk

Thank you for the suggestion. I have extracted all the edit template related changes to #46120

@manzoorwanijk manzoorwanijk added the Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR label Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR [Feature] Publicize Now Jetpack Social, auto-sharing [JS Package] Components [JS Package] Publicize Components RNA [Status] Needs Team Review Obsolete. Use Needs Review instead. [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants