jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Sharing block: ensure compatibility with global settings set in module

Open jeherve opened this issue 1 year ago • 4 comments

Ensure compatibility with sharing settings that may have been created via the old module.

Compatibility may mean separating the settings entirely so the new block is only managed via the block / site editor, but that needs to be made clear in settings UI.

This issue may be broken down into multiple issues if necessary.


Epic: https://github.com/Automattic/jetpack/issues/19694

jeherve avatar Nov 14 '23 14:11 jeherve

While working on https://github.com/Automattic/jetpack/issues/34115 (hook new block buttons to Sharing_Service) we basically has copied the logic needed inside the block, having it entirely separated from the Sharing Service.

We would still need to see, what would be the less confusing way to go, either entirely replace current logic (including central buttons controls in calypso), or make these work together.

I suggest we hold off this task until we get some feedback from Call For Testing.

andrii-lysenko avatar Dec 11 '23 15:12 andrii-lysenko

#35542 brings us in this direction, but doesn't have any UI yet. We'll need to work on one, that will set the jetpack_sharing_buttons_auto_add option when toggled. It is necessary, since we do not want to add the block to all sites as soon as they activate the plugin.

jeherve avatar Feb 21 '24 15:02 jeherve

I think the easiest way would be if we could add UI to wp.com side on https://wordpress.com/marketing/sharing-buttons/:site. We probably could add a notice there (for sites with block based themes), that has a link to Sharing Buttons docs and a button, that will switch to new behavior. Underhood, it would toggle jetpack_sharing_buttons_auto_add for the site and disable old Sharedaddy feature.

Following up https://github.com/Automattic/jetpack/pull/35542 we could read these settings (could we?) and fill with buttons and styles from old module. Also, on https://:site/wp-admin/admin.php?page=jetpack#/sharing, we might add another toggle, that will do the same for sites, where the old module enabled. If for some reason we can't do these manipulation from wp.com side, we could probably redirect users to page=jetpack#/sharing and utilize that switch.

In terms of tasks I imagine it something like:

  • Follow up with https://github.com/Automattic/jetpack/pull/35542 to add buttons based on settings from old module if user has ones. It should also correctly handle Official button defaulting to classic view and More button which should be skipped at this time.
  • Follow up with https://github.com/Automattic/jetpack/pull/35542 and possibly adding new filters to be able to add a sharing buttons to other templates matching old feature settings (posts, pages, media, etc.).
  • Modify https://:site/wp-admin/admin.php?page=jetpack#/sharing, adding a button/toggle that will automatically set jetpack_sharing_buttons_auto_add to true and old module feature to false.
  • Modify https://wordpress.com/marketing/sharing-buttons/:site to either have a button that does everything automatically or navigates to https://:site/wp-admin/admin.php?page=jetpack#/sharing

cc @keoshi

andrii-lysenko avatar Feb 29 '24 22:02 andrii-lysenko

we could add UI to wp.com side on https://wordpress.com/marketing/sharing-buttons/:site

If we do, we would definitely need to add the same UI to wp-admin/admin.php?page=jetpack#/sharing. We should avoid adding more UI elements that would only be available in Calypso.

jeherve avatar Mar 04 '24 14:03 jeherve

I created https://github.com/Automattic/wp-calypso/pull/88294 to start with some improvements, and we're also discussing other options in https://github.com/Automattic/dotcom-forge/issues/5915

jeherve avatar Mar 07 '24 14:03 jeherve