Skip to content

Conversation

@dsas
Copy link
Contributor

@dsas dsas commented Nov 28, 2025

Fixes DOTCOM-15286

Proposed changes:

Unify Jetpack React and Calypso implementations of Newsletter Settings into a new WordPress DataForm-based UI, and in the darkness bind them.

Creates a new UI that will eventually replace the two existing UIs:

This fixes DOTCOM-15286, there are further tasks to add tracks, make it load on simple sites, remove old implementations etc.

!! This does not work on simple sites yet !! Jetpack loads funny there. It also doesn't break anything and doesn't load anywhere unless you opt-in, so it's fine.

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

Jetpack product discussion

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

No changes to data tracking or activity tracking. Tracking events will be added in a separate PR.

Testing instructions

Test Steps:

  1. Make add_filter( 'jetpack_wp_admin_newsletter_settings_enabled', '__return_true' ); run early, e.g. by adding it to a new mu-plugin or just by pasting it into the top of jetpack-dev/jetpack.php using the plugin file editor on a jurassic ninja site.
  2. Enable the newsletter module if it isn't already
  3. Navigate to Jetpack → Newsletter in WordPress admin
  4. Use the different form fields, and check the functionality works
  5. You can reference the existing calypso / jetpack UIs - they're not 1:1 clones, but it should offer the same capabilities that they do.

Platform-Specific Behavior

wpcom Simple Sites:

  • Verify Newsletter menu item is always visible in Jetpack menu (cannot be hidden)
  • Verify Newsletter toggle section is NOT displayed (module is always active)
  • Confirm all other sections (Subscriptions, Email config, etc.) are visible and functional

wpcom Atomic (WoA) Sites:

  • With module active: Verify Newsletter menu item appears in Jetpack menu
  • With module inactive: Verify Newsletter menu item is hidden, but direct URL (/wp-admin/admin.php?page=jetpack-newsletter)
    still works
  • Verify Newsletter toggle section is displayed and functional
  • Test toggling the newsletter off, reloading the page, and toggling it back on

Jetpack Sites:

  • With module active: Verify Newsletter menu item appears in Jetpack menu
  • With module inactive: Verify Newsletter menu item is hidden, but direct URL still works
  • Verify Newsletter toggle section is displayed and functional
  • Test module reactivation flow from settings page

Module State Handling

  • On Jetpack/Atomic sites, deactivate the subscriptions module from Jetpack settings
  • Navigate directly to /wp-admin/admin.php?page=jetpack-newsletter
  • Verify page loads without errors
  • Toggle "Let visitors subscribe to this site..." to reactivate the module
  • Verify Newsletter menu item appears after reactivation

The settings screen should look like this on an atomic site:
Screen Shot 2025-12-05 at 16 16 05-fullpage

@dsas dsas marked this pull request as draft November 28, 2025 17:04
@dsas dsas self-assigned this Nov 28, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 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 dotcom-15286-build-out-the-settings-screen branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack dotcom-15286-build-out-the-settings-screen
bin/jetpack-downloader test jetpack-mu-wpcom-plugin dotcom-15286-build-out-the-settings-screen

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 Nov 28, 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!


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: January 6, 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 Nov 28, 2025
@dsas dsas added [Status] In Progress [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of 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 Nov 28, 2025
@jp-launch-control
Copy link

jp-launch-control bot commented Nov 28, 2025

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/packages/newsletter/src/class-settings.php 0/88 (0.00%) 0.00% 43 💔
projects/plugins/jetpack/load-jetpack.php 1/42 (2.38%) -0.06% 1 ❤️‍🩹

Full summary · PHP report · JS report

If appropriate, add one of these labels to override the failing coverage check: Covered by non-unit tests Use to ignore the Code coverage requirement check when E2Es or other non-unit tests cover the code Coverage tests to be added later Use to ignore the Code coverage requirement check when tests will be added in a follow-up PR I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage.

@dsas dsas force-pushed the dotcom-15286-build-out-the-settings-screen branch from e4259ed to 90c16c2 Compare December 4, 2025 18:45
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Dec 4, 2025
dsas added 5 commits December 5, 2025 12:55
Register the settings screen, even if not adding it to the menu due to
it being disabled. This means that after disabling newsletter
(subscriptions) module, users can still reload the page and re-enable
it.

Note that WordPress.com simple sites cannot disable the module.
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 implements a comprehensive newsletter settings UI using WordPress DataForm components, unifying Jetpack and Calypso implementations into a single, modern interface. The implementation follows a card-based design pattern with distinct sections for different settings groups.

Key Changes:

  • Introduces React-based settings UI with DataForm for declarative form handling
  • Implements mixed save patterns: auto-save for some sections, manual save with staged changes for others
  • Adds PHP backend support for menu registration with platform-specific logic (wpcom simple/atomic vs Jetpack)

Reviewed changes

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

Show a summary per file
File Description
projects/plugins/jetpack/load-jetpack.php Initializes Newsletter Settings class early for admin access
projects/packages/newsletter/src/class-settings.php Adds menu registration logic, settings data exposure, and module state checking
projects/packages/newsletter/src/settings/index.tsx Main settings app with state management, API integration, and section orchestration
projects/packages/newsletter/src/settings/types.ts TypeScript type definitions for settings data and Jetpack configuration
projects/packages/newsletter/src/settings/utils.ts Utility functions for subscriber management URLs
projects/packages/newsletter/src/settings/style.scss Card-based styling with disabled state handling and component theming
projects/packages/newsletter/src/settings/sections/*.tsx Individual section components for newsletter, subscriptions, email config, categories, and welcome email
projects/packages/newsletter/src/settings/components/*.tsx Shared components for header, byline preview, and toggle controls with editor links
projects/packages/newsletter/webpack.config.js Adds babel plugin for textdomain replacement
projects/packages/newsletter/package.json Adds dependencies for components, API, and WordPress packages
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

@dsas dsas marked this pull request as ready for review December 5, 2025 17:10
@dsas dsas added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Dec 5, 2025
@dsas dsas requested a review from a team December 8, 2025 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Newsletter [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Review This PR is ready for review. [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.

2 participants