Skip to content

Sharing & Likes: Make the template placements one radio choice, with "Don't add it" first - #54212

Merged
jeherve merged 3 commits into
trunkfrom
update/sharing-likes-placement-radio
Oct 28, 2026
Merged

jeherve merged 3 commits into
trunkfrom
update/sharing-likes-placement-radio

Conversation

@jeherve

@jeherve jeherve commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Fixes CM-998

Proposed changes

On block themes, the Sharing buttons and Like buttons sections of the React Settings > Sharing screen offer two cards that add the section's block before or after the post content. The cards are checkboxes, but you can only pick one: ticking one unticks the other, and a "Pick one place: before or after the content." hint is there to explain it. During the call for testing, one of the testers asked whether they should be radio buttons. They should :)

Each section is now one radio group with three choices:

  • "Don't add it automatically", first. That's where a site is when it first switches to the blocks.
  • "Before the content" and "After the content", as cards, with the same illustrations and "Preview and edit" link as before.

The legend is now a question those three choices answer, "Where should the Sharing Buttons block go on posts and pages?" (or the Like block), and the hint is gone.

The cards are a new RadioCard in @automattic/jetpack-components, next to CheckboxCard. The two share their styles through selectable-card/_selectable-card.scss. CheckboxCard compiles to the same CSS as before, so Newsletter's cards don't change.

Before After
Nothing placed yet Sharing buttons section before: two unticked checkbox cards under a "Pick one place" hint Sharing buttons section after: "Don't add it automatically" selected above two radio cards
"After the content" picked Sharing buttons section before: the "After the content" checkbox card ticked Sharing buttons section after: the "After the content" radio card selected, with its "Preview and edit" link

Rationale

Three answers, so a radio group. #53838 kept the cards as checkboxes because two radios would have had no way to take the block out again; unticking the ticked card was how it came out. A third option covers that. Screen readers announced two independent checkboxes for what is one choice; they now announce one radio group, named by the question, with three options.

"Don't add it automatically" comes first. It's the default, so the group reads in order: no, before, after. The arrow keys move in that order too. I considered drawing it as a third card, but a wireframe of a post with nothing added doesn't say much next to the other two, and three cards don't fit the two-column grid. As a plain radio, it leaves the cards as the obvious thing to pick.

Same saves as before. Picking a card sends ['before_content'] or ['after_content'], and the first option sends [], through the same useSaveSetting(), so the route still never sees both sides. While settings catch up after "Switch to the … block", the whole group shows disabled, as the cards did.

Of note, radio groups select as you arrow through them, so going from "Don't add it automatically" to "After the content" with the keyboard saves twice. The write queue sends both in order, and the last one wins.

It doesn't touch the PHP screen, or the cards' disabled styling: while the group is disabled, only the radios fade, as the checkboxes did. Changing that would also change Newsletter's cards.

The React screen is still behind rsm_jetpack_ui_modernization_sharing_likes, so the changelog entries are in the packages only.

Related product discussion/links

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

No.

Testing instructions

On a connected Jetpack site running a block theme (Twenty Twenty-Four or Twenty Twenty-Five), with the Sharing and Likes modules on and this in an mu-plugin:

add_filter( 'rsm_jetpack_ui_modernization_sharing_likes', '__return_true' );
  • Go to Settings > Sharing, and click "Switch to the Sharing Buttons block" and "Switch to the Like block".
  • Both sections now ask "Where should the … block go on posts and pages?", with "Don't add it automatically" selected and two cards under it.
  • In Sharing buttons, click the "After the content" card. "Don't add it automatically" is no longer selected, and a "Preview and edit" link shows under the card once the save goes through. A single post shows the Sharing Buttons block under its content.
  • In Like buttons, Tab to the group and press the down arrow. "Before the content" gets selected and saved.
  • Reload the page: both choices are still selected, and the post shows the Like block above its content.
  • In Like buttons, pick "Don't add it automatically". The Like block is gone from the post.
  • With a screen reader, each section reads as a radio group named by its question, with three options.

Part of CM-998

The Sharing & Likes screen uses CheckboxCard for its template
placements, but a block goes on one side of the post content at most,
so the two cards were a single choice drawn as two checkboxes. Screen
readers announced independent checkboxes, and ticking one unticked
the other. The screen needs the same card with a radio in it.

RadioCard has the CheckboxCard props minus `checked` and `onChange`:
the surrounding RadioGroup owns the value, and the card gives it its
`value`. It needs a Field.Root around that group, as the Field.Item it
renders requires one. The card shows as selected through the radio's
`data-checked` attribute, so it needs no prop for that either.

The grid, card, illustration and control rules move to mixins in
selectable-card/_selectable-card.scss, shared by both cards.
CheckboxCard compiles to the same CSS as before.
Part of CM-998

The cards placing the Sharing Buttons and Like blocks were checkboxes
that unticked each other, since core only hooks a block on one side of
the post content. A tester on the call for testing asked whether they
should be radio buttons, as you can only pick one. They should: the
choice has three answers, before the content, after it, or neither.
The checkboxes needed a "Pick one place" hint to explain that, and
screen readers still announced two independent controls.

Each section now renders one radio group: "Don't add it automatically"
first, the state a site starts in after switching to the blocks, then
a RadioCard per side. The legend is a question those three answers
fit, and the hint goes. Picking a card still saves a one-item list and
the first option an empty one, so the route never sees both sides.
While settings catch up after "Switch to the … block", the whole group
shows disabled, as the cards did.
@jeherve jeherve added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Status] Needs Review This PR is ready for review. labels Oct 28, 2026
@jeherve jeherve self-assigned this Oct 28, 2026
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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 update/sharing-likes-placement-radio branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/sharing-likes-placement-radio
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/sharing-likes-placement-radio

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
Copy Markdown
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 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!

@jp-launch-control

jp-launch-control Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/sharing-likes/src/settings-app/components/template-placements.tsx 22/22 (100.00%) 0.00% 0 💚

2 files are newly checked for coverage.

File Coverage
projects/js-packages/components/components/radio-card/index.tsx 4/5 (80.00%) 💚
projects/js-packages/components/components/radio-card/types.ts 0/0 (—%) 🤷

Full summary · PHP report · JS report

@jeherve
jeherve merged commit cb339d9 into trunk Oct 28, 2026
184 of 187 checks passed
@jeherve
jeherve deleted the update/sharing-likes-placement-radio branch October 28, 2026 16:18
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Review This PR is ready for review. labels Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs Enhancement Changes to an existing feature — removing, adding, or changing parts of it [JS Package] Components [Package] Sharing Likes RNA [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant