Skip to content

Conversation

@gmjuhasz
Copy link
Contributor

@gmjuhasz gmjuhasz commented Dec 16, 2025

Fixes SOCIAL-16

Proposed changes:

  • Move the Share post action from the post-list package to the Publicize package for better discoverability
  • The Share action now appears automatically for users with plans that support the republicize feature
  • Maintain backward compatibility with the existing jetpack_post_list_display_share_action filter

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)?

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

No

Testing instructions:

  1. On a site with a plan that supports republicize (Jetpack Social or higher):

    • Go to Posts > All Posts
    • Hover over a published post
    • Verify the "Share" action appears in the row actions
    • Click Share and verify it opens the editor with the share panel
  2. On a site without republicize support:

    • Verify the Share action does NOT appear by default
    • Add add_filter( 'jetpack_post_list_display_share_action', '__return_true' ); to enable it
    • Verify the Share action now appears (backward compatibility)
  3. Verify the Share action only appears for:

    • Published posts (not drafts)
    • Post types that support publicize
    • Post types that use the block editor
    • Social Notes

Move the Share post action functionality from the post-list package
to the Publicize package for better discoverability. The Share action
now appears automatically for users with plans that support the
'republicize' feature, while maintaining backward compatibility with
the existing `jetpack_post_list_display_share_action` filter.
@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 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 SOCIAL-16 branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack SOCIAL-16

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 16, 2025

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!


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.


Wpcomsh plugin:

  • Next scheduled release: Atomic deploys happen twice daily on weekdays (p9o2xV-2EN-p2)

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Dec 16, 2025
@jp-launch-control
Copy link

jp-launch-control bot commented Dec 16, 2025

Code Coverage Summary

Coverage changed in 4 files.

File Coverage Δ% Δ Uncovered
projects/packages/publicize/src/class-publicize-setup.php 13/78 (16.67%) 16.67% -1 💚
projects/plugins/social/src/class-note.php 0/102 (0.00%) 0.00% -2 💚
projects/packages/post-list/src/class-post-list.php 54/81 (66.67%) 3.78% -9 💚
projects/plugins/wpcomsh/feature-plugins/post-list.php 0/5 (0.00%) 0.00% -9 💚

Full summary · PHP report · JS report

@gmjuhasz gmjuhasz self-assigned this Dec 17, 2025
@gmjuhasz gmjuhasz added the [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it label Dec 17, 2025
@gmjuhasz gmjuhasz requested a review from a team December 17, 2025 09:09
@gmjuhasz gmjuhasz marked this pull request as ready for review December 17, 2025 09:09
Copy link
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a good and timely reminder that we need to wire up this with the unified modal.

@gmjuhasz
Copy link
Contributor Author

This PR is a good and timely reminder that we need to wire up this with the unified modal.

@manzoorwanijk You mean you want it to open the modal as well? Current trunk behaviour is opening the editor with the Jetpack tab open

@manzoorwanijk
Copy link
Member

manzoorwanijk commented Dec 17, 2025

You mean you want it to open the modal as well? Current trunk behaviour is opening the editor with the Jetpack tab open

No, the current behavior is to open the resharing modal. You may be testing on a site with unified UI feature flag.

I have created a task for it - SOCIAL-277

@manzoorwanijk
Copy link
Member

It's done here

// Then open the share post modal
dispatch( socialStore ).openSharePostModal();

@gmjuhasz
Copy link
Contributor Author

Yeah the flag could be the cause. I'll extend this PR to make it work with the new modal

@gmjuhasz
Copy link
Contributor Author

Or it might also make sense to close this with the move, and I can create a separate one for fixing the modal, to keep them atomic

@manzoorwanijk
Copy link
Member

Or it might also make sense to close this with the move, and I can create a separate one for fixing the modal, to keep them atomic

Yeah, we can do that and it's better to keep them separate

Copy link
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works well but I have a suggestion about a minor improvement to retain the current behavior.

Also, there is some logic related to it (jetpack_post_list_display_share_action) in the Social plugin as well. Should we clean that up?

@gmjuhasz gmjuhasz added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Dec 17, 2025
@manzoorwanijk
Copy link
Member

I have made that unified modal change in #46336. That should make it easier to test this change with and without the unified UI feature flag.

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 moves the "Share post" row action from the post-list package to the Publicize package to improve discoverability. The Share action is now automatically enabled for sites with plans that support the republicize feature, while maintaining backward compatibility with the existing jetpack_post_list_display_share_action filter.

Key Changes:

  • The Share action is now automatically shown for plans with republicize support (Jetpack Social or higher)
  • Added new methods maybe_add_share_action() and add_share_action() to Publicize_Setup class
  • Maintained backward compatibility with the jetpack_post_list_display_share_action filter

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
projects/packages/publicize/tests/php/Share_Action_Test.php New test file covering Share action functionality including filter behavior, screen checks, and post type support validation
projects/packages/publicize/src/class-publicize-setup.php Adds Share action implementation with automatic plan-based activation and filter hook integration
projects/packages/publicize/changelog/add-share-post-action Documents the addition of Share action to Publicize package
projects/packages/post-list/tests/php/Post_List_Test.php Updates tests to remove Share action assertions and focus on thumbnail/copy link functionality
projects/packages/post-list/src/class-post-list.php Removes Share action methods (maybe_add_share_action and add_share_action)
projects/packages/post-list/changelog/remove-share-action Documents the removal of Share action from post-list package

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

Add proper tear_down() method that clears the Current_Plan static
cache using reflection to prevent test isolation issues with
subsequent tests that depend on plan feature checks.
@gmjuhasz gmjuhasz removed the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Dec 17, 2025
@manzoorwanijk
Copy link
Member

@gmjuhasz what about this?

there is some logic related to it (jetpack_post_list_display_share_action) in the Social plugin as well. Should we clean that up?

@github-actions github-actions bot added [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Wpcomsh labels Dec 17, 2025
@gmjuhasz
Copy link
Contributor Author

Yeah that got lost in the comments. Added it now @manzoorwanijk . Also removed from the wpcomsh plugin as now the filter defaults to true so its redundant

@manzoorwanijk
Copy link
Member

I am waiting for the build to finish to test the wpcomsh change on Atomic sites.

manzoorwanijk
manzoorwanijk previously approved these changes Dec 17, 2025
Copy link
Member

@manzoorwanijk manzoorwanijk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine on Jetpack, Atomic, and Simple ✅

Thank you for the changes.

*/
function wpcomsh_post_list_init() {
add_filter( 'jetpack_block_editor_republicize_feature', '__return_true' );
wpcomsh_maybe_enable_share_action();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this change cause issues on Atomic when they receive the wpcomsh change today but Jetpack change on Monday?

Copy link
Member

@manzoorwanijk manzoorwanijk Dec 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, my apprehension is correct. I tested this change with wpcomsh from this branch and Jetpack RC and the Share button is gone.

image

So, it means that we may need to hold off merging this till Monday morning.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, we can extract the wpcomsh change into a separate PR and merge that after the next Atomic deployment. That will unblock this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine to wait until Monday, it's not urgent to ship, and not likely to get conflicts either

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. Thanks

@manzoorwanijk manzoorwanijk added DO NOT MERGE don't merge it! and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Dec 17, 2025
@manzoorwanijk manzoorwanijk dismissed their stale review December 17, 2025 11:33

Let us wait till Monday to merge this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE don't merge it! [Feature] Publicize Now Jetpack Social, auto-sharing [Package] Post List [Package] Publicize [Plugin] Social Issues about the Jetpack Social plugin [Plugin] Wpcomsh [Status] In Progress [Tests] Includes Tests [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