Skip to content

Newsletter: flip the modernization filter default + retire legacy (PR 6 / #48530)#48613

Open
keoshi wants to merge 6 commits intotry/newsletter-modernization-wpds-cardsfrom
try/newsletter-modernization-flip-flag
Open

Newsletter: flip the modernization filter default + retire legacy (PR 6 / #48530)#48613
keoshi wants to merge 6 commits intotry/newsletter-modernization-wpds-cardsfrom
try/newsletter-modernization-flip-flag

Conversation

@keoshi
Copy link
Copy Markdown
Contributor

@keoshi keoshi commented May 7, 2026

Closes #48530 — final PR of the six-PR Newsletter modernization rollout. Stacked on #48608 (Settings on WPDS Card primitives). Once #48608 merges, GitHub auto-flips this PR's base to trunk.

Proposed changes

  • Flip the modernization filter default to true. Newsletter\Settings::is_modernized() now defaults the rsm_jetpack_ui_modernization_newsletter filter to true. Every Jetpack site lands on the unified Subscribers/Settings chassis without any opt-in. Hosts that need the legacy AdminPage surface back can add_filter( 'rsm_jetpack_ui_modernization_newsletter', '__return_false' );. The Subscribers REST gate (class-wpcom-rest-api-v2-endpoint-subscribers-list.php) flips its default the same way so the proxy registers without an explicit filter.
  • Retire the standalone Subscribers wp-admin menu and Calypso shortcut. modules/subscriptions.php drops the add_subscribers_menu method (the "Subscribers ↗" Calypso link on self-hosted) and the Subscribers_Dashboard::init() call (the wp-admin Subscribers page registration). jetpack-mu-wpcom's wpcom-admin-menu.php collapses the // Jetpack > Subscribers. if/else into a wpcom_hide_submenu_page call so nothing surfaces the Calypso link, and 'subscribers' drops out of the Jetpack submenu order list. Newsletter is the single Subscribers entry now.
  • Remove the subscribers-dashboard package. Delete projects/packages/subscribers-dashboard/ outright and pull automattic/jetpack-subscribers-dashboard from plugins/jetpack, packages/jetpack-mu-wpcom, and packages/masterbar. Refresh composer.lock (Jetpack plugin) and pnpm-lock.yaml so the autoload classmap and pnpm graph stop carrying the package.
  • Wire the jetpack_newsletter_tab_view Tracks event. Fire it from NewsletterPage's onTabChange with { site_type, tab } whenever the visitor flips to a different tab; same-tab clicks no-op. Analytics init was already lifted to the page Stage in PR 2, but PR 2's load_admin_scripts short-circuit was also skipping the jp-tracks enqueue, so events queued into _tkq forever and pixel.wp.com/t.gif never fired. Move the jp-tracks enqueue above the modernization short-circuit so the Tracks transport loads on both surfaces.

ARIA + RTL audited in the browser:

  • Tabs primitive ships role="tablist" + role="tab" + role="tabpanel" with the right aria-selected / aria-labelledby / tabindex plumbing out of the box (Base UI under the hood).
  • Setting dir="rtl" flips the page header (logo + "Newsletter" sit on the right, in the correct semantic order), the Subscribers/Settings tab nav, and the Newsletter card's two-link footer (Privacy / Manage subscribers bracket the row in flipped positions).

Related product discussion/links

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

  • REST surface. No new endpoints — the Subscribers proxy filter default flips along with the chassis filter, but the same routes register.
  • New Tracks event. jetpack_newsletter_tab_view fires with { site_type, tab } on tab change. No new identifiers or PII; matches the pattern other Jetpack page-tab events use.
  • No changes to privacy notices.
  • add_script_data payload. No new keys (the subscriberManagementEnabled key landed in PR 4).

Testing instructions

Pull this branch, run pnpm install, composer install inside projects/plugins/jetpack/, and pnpm jetpack build packages/newsletter --deps to refresh the Newsletter package and its dependencies.

Default-on (the new behaviour)

  • Make sure no add_filter( 'rsm_jetpack_ui_modernization_newsletter', ... ) lives in any mu-plugin / wp-config.php / theme / Code Snippet.
  • Visit wp-admin/admin.php?page=jetpack-newsletter. The unified chassis renders straight away — page header with the Jetpack mark + "Newsletter", Subscribers/Settings tabs, the WPDS Card layout in Settings, the Subscribers DataViews list under the Subscribers tab.
  • The Jetpack sidebar no longer shows "Subscribers ↗" (or a wp-admin "Subscribers" page on hosts that previously had jetpack_wp_admin_subscriber_management_enabled on).
  • Confirm pixel.wp.com/t.gif?...&_en=jetpack_newsletter_tab_view&tab=... requests fire when switching tabs (DevTools → Network, filter pixel.wp.com).

Opt-out path

  • Add add_filter( 'rsm_jetpack_ui_modernization_newsletter', '__return_false' ); to a mu-plugin or Code Snippet.
  • Hard-refresh — the legacy Newsletter Settings page returns (Jetpack-styled AdminPage chrome with the green logo header). The settings still save, the cards still render with WPDS primitives (PR 5 already updated the shared body).

RTL smoke check

  • Switch to an RTL admin language (e.g., Hebrew) or set dir="rtl" on <html>/<body> in DevTools.
  • The page header (logo + Newsletter), tab nav, save buttons, and the Newsletter card's two-link footer all flip to the opposite side; nothing collides with the wp-admin sidebar.

Keyboard / ARIA smoke check

  • Tab into the tab nav, arrow keys cycle Subscribers ↔ Settings, Enter / Space activates. Screen reader announces "Subscribers, tab, 1 of 2, selected" / "Settings, tab, 2 of 2".

Screenshots

To be added once the PR review begins (the visual surface is the same as #48608 with the modernization filter implicitly on).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

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 try/newsletter-modernization-flip-flag branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack try/newsletter-modernization-flip-flag
bin/jetpack-downloader test jetpack-mu-wpcom-plugin try/newsletter-modernization-flip-flag

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 [Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [mu wpcom Feature] Wpcom Admin Menu [Package] Jetpack mu wpcom WordPress.com Features [Package] Masterbar [Package] Newsletter [Package] Subscribers Dashboard [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests labels May 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

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: June 2, 2026
    • Code freeze: June 1, 2026

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 May 7, 2026
@keoshi keoshi self-assigned this May 7, 2026
@keoshi keoshi added [Status] Needs Review This PR is ready for review. 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 May 7, 2026
@keoshi keoshi requested review from CGastrell, dhasilva and ilonagl May 7, 2026 16:27
keoshi added 6 commits May 7, 2026 14:43
Every Jetpack site now lands on the unified Subscribers/Settings
chassis we've been building since PR 1. The legacy `AdminPage`
chrome stays in the bundle behind the same filter, so hosts that
need the old surface back can opt out with
`add_filter( 'rsm_jetpack_ui_modernization_newsletter', '__return_false' );`
until the legacy code paths are removed in a follow-up.
The unified Newsletter page now owns the Subscribers tab, so neither
the wp-admin Subscribers submenu nor the "Subscribers ↗" Calypso
link belongs in the sidebar anymore.

* `modules/subscriptions.php`: drop the `add_subscribers_menu`
  method (and its `jetpack_admin_menu` hook) that registered the
  Calypso shortcut on self-hosted, plus the `Subscribers_Dashboard`
  init that registered the standalone wp-admin Subscribers page on
  hosts with `jetpack_wp_admin_subscriber_management_enabled` on.
  Drop the now-unused `Admin_Menu` and `Redirect` imports.
* `jetpack-mu-wpcom/wpcom-admin-menu.php`: collapse the
  `// Jetpack > Subscribers.` if/else into a single
  `wpcom_hide_submenu_page` call — the Calypso link no longer surfaces
  here either way, but we keep the hide so anything else that adds it
  back stays out of the sidebar. Drop `Subscribers_Dashboard` import
  and remove `'subscribers'` from the Jetpack submenu order list.

Newsletter is now the single Subscribers entry point. The
`subscribers-dashboard` package will be deleted in the next commit.
Now that no plugin instantiates `Subscribers_Dashboard` (the previous
commit retired both call sites), the package has no consumers and can
go. Delete `projects/packages/subscribers-dashboard/` outright.

Pull the `automattic/jetpack-subscribers-dashboard` dep out of
`plugins/jetpack/composer.json`, `packages/jetpack-mu-wpcom/composer.json`,
and `packages/masterbar/composer.json` (none of those packages were
using it directly), refresh the Jetpack plugin's `composer.lock` and
the workspace `pnpm-lock.yaml` so the autoload classmap and pnpm
graph stop carrying the package. Standalone `Subscribers` page is
fully retired — Newsletter is the single Subscribers entry now.
Record a tracks event whenever the visitor flips to a different tab —
`{ site_type, tab }`. The guard skips the no-op case where
`next === activeTab`, so refreshes and same-tab nav don't pollute the
counts. Analytics is already initialized at the page Stage (PR 2), so
the event reaches Tracks immediately on first interaction.
PR 2 lifted analytics initialization to the page Stage but
`load_admin_scripts` was still short-circuiting before any script
enqueue ran when modernization was on. `analytics.initialize` queues
events into `window._tkq`, but without the Tracks transport
(`stats.wp.com/w.js`) loaded, the queue grows forever and no
`pixel.wp.com/t.gif` requests fire — telemetry from PR 6's new
`jetpack_newsletter_tab_view` event went nowhere.

Move the `jp-tracks` enqueue above the modernized short-circuit so
it runs on both surfaces; everything else (the legacy
`jetpack-newsletter` bundle, JetpackScriptData, etc.) stays gated to
the legacy path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Masterbar WordPress.com Toolbar and Dashboard customizations [mu wpcom Feature] Wpcom Admin Menu [Package] Jetpack mu wpcom WordPress.com Features [Package] Masterbar [Package] Newsletter [Package] Subscribers Dashboard [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Review This PR is ready for review. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant