Skip to content

Newsletter: explain the paywall constraint in the Audience panel - #51394

Merged
allilevine merged 4 commits into
trunkfrom
update/newsletter-audience-paywall-notice
Aug 19, 2026
Merged

allilevine merged 4 commits into
trunkfrom
update/newsletter-audience-paywall-notice

Conversation

@allilevine

@allilevine allilevine commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

Fixes NL-832

Proposed changes

When a post contains a paywall block, the Audience panel used to drop Everyone from the radio group and render a Paywall card above it:

The content below the paywall block is exclusive to the selected audience. Edit the block.

That button called selectBlock() but nothing switched the settings sidebar from the Document tab to the Block tab, so on desktop it looked inert.

Rather than fix the link, this replaces the card with a new design discussed in p1787001127697179/1786626588.168549-slack-C03NLNTPZ2T

  • Everyone stays visible and disabled when a paywall block is present, instead of disappearing. This is the treatment Paid subscribers already gets when paid subscriptions aren't set up — visible but not selectable, so the constraint is discoverable.
  • A notice above the radio group says why it can't be chosen: "Paywall active — Choose who can read the full post. Everyone can still read the content above the paywall." It uses @wordpress/ui's Notice, whose Title / Description slots are exactly this shape, and which is bundled here so it renders identically regardless of the site's WordPress version. (@wordpress/components' Notice is an external and resolves to whatever WP core ships — on WP 7.0 that is still the older left-bar style, not the design.) icon={ null } suppresses the intent icon to match the mockup — say the word if the default info icon is wanted instead.
  • The "Edit the block." link is gone, along with the card it lived in.
  • accessOptions carried a panelHeading field identical, character for character, to label on all three entries. It had one consumer — the pre-publish panel header — which now reads label. No translation churn: label carries the same strings, so this removes three duplicate __() call sites and no message ids.

The radio group is now built by hand rather than by RadioControl. A disabled Everyone has to sit between the legend and the remaining options, which RadioControl gives no way to reach — it has no per-option disabled.

Before After
Screenshot 2026-08-19 at 2 08 54 PM Screenshot 2026-08-19 at 1 26 02 PM
Screenshot 2026-08-19 at 2 08 59 PM Screenshot 2026-08-19 at 1 25 57 PM

Related product discussion/links

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

No.

Testing instructions

Requires a Jetpack-connected site (the paywall block renders a connect banner otherwise) with the blocks and subscriptions modules active.

  1. Create a new post and open the Audience panel in the Post sidebar. Confirm Everyone, Subscribers and Paid subscribers all appear, with Everyone selected and selectable.
  2. Add a Paywall block to the post (type /paywall).
  3. Back on the Post tab, look at the Audience panel:
    • Everyone is still listed, greyed out and not selectable, and the selection has moved to Subscribers.
    • A notice above the group reads Paywall active / "Choose who can read the full post. Everyone can still read the content above the paywall."
    • The old Paywall card and its Edit the block. button are gone.
  4. Click Everyone — nothing should happen, and the selection should stay on Subscribers.
  5. Focus Subscribers and press ↑ — focus should stay on Subscribers rather than moving to, and selecting, Everyone. Then Tab to Everyone to confirm it's still reachable by keyboard.
  6. Select the paywall block and open its Content access panel. Everyone is listed and disabled there too, but the notice is not repeated — the block card above already explains the paywall.
  7. Click Publish to open the pre-publish panel. The same notice and disabled Everyone appear there, and the panel header still reads Audience: Subscribers.
  8. Save, reload the editor, and confirm the panel comes back in the same state.
  9. Delete the paywall block. Everyone becomes selectable again, the notice disappears, and the access level resets to Everyone.

allilevine and others added 2 commits August 19, 2026 10:55
When a post contains a paywall block, the Audience panel dropped "Everyone"
from the radio group and put a Paywall card above it whose "Edit the block."
button selected the block without switching the sidebar to the Block tab, so
on desktop it looked inert. In the pre-publish panel it was worse: the publish
sidebar covers the canvas, so it selected a block the user could not see.

Rather than fix the link, remove what it was compensating for. "Everyone" now
stays visible and disabled — the treatment "Paid subscribers" already gets when
paid subscriptions are not set up — with a notice above the group saying why it
cannot be chosen. The panel keeps its shape and the constraint is stated where
it applies.

The group is now built by hand instead of by RadioControl, because a disabled
"Everyone" has to sit between the legend and the remaining options, which
RadioControl gives no way to reach. It reuses RadioControl's own classes, and
folds in the disabled-option markup that was already hand-rolled for the paid
option. Disabled options keep the existing contract: aria-disabled rather than
the native attribute, so they stay focusable and announced, and no shared group
name, so arrow keys cannot land on one and select it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Every accessOptions entry carried a panelHeading identical, character for
character, to its label. The field had one consumer, the pre-publish panel
header, which now reads label instead.

No translation churn: label carries the same strings, so this removes three
duplicate __() call sites and no message ids.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 19, 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), and enable the update/newsletter-audience-paywall-notice branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/newsletter-audience-paywall-notice

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 github-actions Bot added [Block] Subscriptions [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests labels Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026 •

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!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: September 7, 2026

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

@jp-launch-control

jp-launch-control Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/shared/memberships/settings.jsx 78/91 (85.71%) 20.16% -18 💚

Full summary · PHP report · JS report

allilevine and others added 2 commits August 19, 2026 11:23
The design shows a bordered, rounded notice with a bold title above the body.
That is @wordpress/ui's Notice, which has Title and Description slots for
exactly this shape and carries its own styles in the bundle.

The first pass used @wordpress/components' Notice and faked the title with a
<strong> and a <br>. That renders as WP core's older `.components-notice` — a
white box with a 4px left bar — because @wordpress/components is an external
resolved to whatever the site's WordPress ships, so the styling drifts by WP
version. @wordpress/ui is bundled here, so the notice looks the same
everywhere. Boost already uses it this way, and this file already imports Link
from the same package.

Notice.Root forwards arbitrary props, so the id "Everyone" points at now sits
on the notice itself and the wrapper span is gone. Dropped the SCSS margin
override with it: the component already has no margin, so the rule did nothing.

icon={ null } suppresses the intent icon, to match the mockup.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The paywall block's Content access panel renders directly beneath Gutenberg's
block card, which already reads "Paywall — Limit access to the content below
this block to chosen subscribers." Stacking the notice under that gave the panel
four blocks of prose, three of them about the paywall, with "Paywall active"
sitting immediately under a heading that says "Paywall" — and pushed the radio
options, the reason to open the panel, below the visible area.

The document sidebar and pre-publish panel keep the notice; only the block
inspector opts out, via explainPaywallConstraint={ false }.

The notice and the option's aria-describedby now derive from a single flag.
Gating just the notice would leave "Everyone" pointing at an id no longer in the
DOM, which assistive tech reports as no description at all — worse than
deliberately having none. A test pins that: the naive two-flag version fails it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@allilevine
allilevine marked this pull request as ready for review August 19, 2026 19:12
@allilevine
allilevine merged commit 24267fa into trunk Aug 19, 2026
79 of 82 checks passed
@allilevine
allilevine deleted the update/newsletter-audience-paywall-notice branch August 19, 2026 19:15
@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] In Progress labels Aug 19, 2026
@github-actions github-actions Bot added this to the jetpack/16.2 milestone Aug 19, 2026
Comment on lines +42 to +48
// The group is built by hand rather than by RadioControl (see AccessOption),
// so it supplies the spacing RadioControl would get from its own VStack.
.components-radio-control__group-wrapper {
display: flex;
flex-direction: column;
gap: 12px;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could just use Stack component and not need these styles.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good call — Stack is in the bundled @wordpress/ui we're already importing from here. Scope is smaller than it looks: it replaces the __group-wrapper block only, and the legend spacing, disabled opacity and description styles stay either way. I'll fold it into next PR.

Comment on lines +192 to +199
return (
<div
className={ clsx( 'components-radio-control__option', {
'jetpack-newsletter-access-radio-buttons__disabled-option': disabled,
} ) }
>
<input
type="radio"

@simison simison Aug 20, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The radio group is now built by hand rather than by RadioControl. A disabled Everyone has to sit between the legend and the remaining options, which RadioControl gives no way to reach — it has no per-option disabled.

Have you looked into whether this could be improved upstream and accomplished that way? That would be ideal.

I'm worried about the implementation; it's relying on styles from upstream which can change (the whole CSS selector can disappear, and cannot be relied upon as stable API), and that nothing ever changes upstream also in the structure of the HTML that the styles apply to. That's sorta fragile and would break quietly.

If you really need to manually rebuild the component, I recommend bringing also the styles so that nothing breaks in future. Still better if there's no need to re-implement core components tho. :-)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Have you looked into whether this could be improved upstream […] it's relying on styles from upstream which can change

Fair, and you're right that the coupling is the weak point. Filed it upstream: WordPress/gutenberg#81939.

Some of what I found while writing it up, since it affects how much this can actually be fixed here:

  • Per-option disabled was implemented upstream once already, in Ability to specify RadioControl options as disabled. WordPress/gutenberg#18930 (2019), and closed in 2022 without landing. It didn't get rejected — it stalled on the disabled-state styling and on screen readers disagreeing about whether a disabled radio should be arrow-key reachable.
  • @wordpress/ui has no Radio primitive at all yet. Radio: Add form primitive to @wordpress/ui WordPress/gutenberg#80799 tried to add one last month and was closed to coordinate with the owner of the form-primitives issue (#74178). So there wasn't a bundled component to reach for.
  • Even if it lands in @wordpress/components tomorrow, it doesn't help us for a while: wp-components is a runtime external (it's in editor.asset.php's dependency list), so it resolves to whatever core ships, and Jetpack's floor is Requires at least: 7.0. We'd carry the manual path as a fallback until the floor moves past whichever release includes it.

On bringing the styles over — I looked at that and I'd push back. Core's radio-control/style.scss is 96 lines that depend on @wordpress/base-styles mixins (radio-control, button-style-outset__focus) and a chain of theme variables resolving to --wpds-*, --wp-components-color-* and --wp-admin-theme-color for the checked dot, focus ring and disabled state. Forking it trades a low-probability silent break for a guaranteed slow one: our radios freeze while every other radio in the editor keeps moving with core.

Separately — this feels like it belongs in the repo's rules rather than dying in a PR thread. Rough bullet for AGENTS.md's "Code Review Guidelines" list:

Markup that re-implements a @wordpress/components component and reuses its components-*__* class names to inherit core styling. Those selectors are not a public API, and @wordpress/components is a runtime external resolved to whatever WordPress core ships — so a rename degrades the UI silently on some WP versions, and no test in this repo can catch it. Check whether a bundled component (@wordpress/ui) covers the case; if the gap is genuinely upstream, note that a fix to @wordpress/components is unusable here until the plugin's "Requires at least" passes the release carrying it, so the local implementation stays either way.

Does that framing match how you'd put it? Happy to open a PR if so, or to defer to your wording if you'd rather write it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Closing the loop, upstream PR merged:

Thank you, @allilevine for filing the issue!

It will take a moment before that's available in WP supported by Jetpack but that's why it's important to get the core ball rolling early.

import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import { Link as ExternalLink } from '@wordpress/ui';
import { Link as ExternalLink, Notice } from '@wordpress/ui';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not related to this PR and pre-existing, but noting that the custom Link below is basically just re-implementing Link, so why not just use Link everywhere and no need this weird rename? 🙃 All the custom one does is remove text-decoration which feels like a design-smell as we should really just be able to use UI components as-is.

export function Link( { href, children } ) {
return (
<a target="_blank" rel="noopener noreferrer" href={ href } className="jetpack-newsletter-link">
{ children }
</a>
);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, the whole Link isn't used anywhere. :-) The only thing importing it is the test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cleaning it up in #51427

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nice catch that it was dead entirely — thanks for cleaning it up in #51427.

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

Labels

[Block] Paywall [Block] Subscriptions [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [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.

2 participants