Repository navigation
Conversation
Swap ToggleControl imports from @automattic/jetpack-components to @wordpress/components across the Newsletter settings screen. Drop the unused 'toggling' prop (and pre-existing 'toogling' typo) since the call sites already disable during save via the 'disabled' prop. Add __nextHasNoMarginBottom to keep wp-admin margin behavior. Part of #48160.
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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 🤖 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: Follow this PR Review Process:
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:
If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack. |
|
Closing — this PR migrated the old Jetpack admin SPA Newsletter tab, but the intended target was the new dedicated Newsletter page ( |
Proposed changes
ToggleControlimports from@automattic/jetpack-componentsto@wordpress/componentsacross the Jetpack Newsletter settings screen (plugins/jetpack/_inc/client/newsletter/), covering theNewsletter,Subscriptions,Email configuration, andNewsletter categoriessections.togglingprop (and a pre-existingtooglingtypo that was never doing anything). Every call site already setsdisabled={ isSavingAnyOption( … ) }, so the toggle remains unclickable during saves — we lose only the wrapper's optimistic visual flip, matching the standard wp-admin behavior.__nextHasNoMarginBottomon each migrated call site to keep the wrapper's default margin-bottom behavior.ToggleControlre-export in@automattic/jetpack-componentsalone — dead-code removal is out of scope for this narrow consumer migration (see #48160 for the tracking issue).Other information
Part of the #48160 migration off
@automattic/jetpack-components. Follows the same shape as #48170 (RadioControl) and #48156 (Badge).Note: the old Newsletter settings tab in the Jetpack admin SPA is hidden by default since #47750 (
jetpack_wp_admin_newsletter_settings_enabledfilter defaults totrue, redirecting users to the new dedicated Newsletter page). The old screen still renders when a site filters that back tofalse, which is how the before/after screenshots below were captured.Screenshots
admin.php?page=jetpack#/newsletter)JN rsync target:
plugins/jetpack· Baseline: trunk (sync-current — the branch was identical to trunk at capture time) · JN site:thoughtfully-remarkable-device.jurassic.ninja· Pre/post renders are pixel-identical, as expected for Option A (direct library swap, no optimistic flip behavior change needed becausedisabledalready blocks interaction during saves).Testing instructions
Reproduce the old Newsletter settings UI by setting
jetpack_wp_admin_newsletter_settings_enabledtofalsevia a mu-plugin (add_filter( 'jetpack_wp_admin_newsletter_settings_enabled', '__return_false' );).Visit Jetpack → Settings → Newsletter.
Verify the four sections render: Newsletter, Subscriptions (Homepage and posts / Navigation / Comments), Newsletter categories, and Email configuration (Email byline toggles, Featured image toggle).
Toggle each
ToggleControl— the toggle should flip, save in the background, and the persisted state should match after the request resolves. The toggle is disabled during save (same as before).Browser console is clean on mount and during toggling.
No visible margin regressions between sections.
Changelog entry added (
plugins/jetpack, patch / other).Visual diff reviewed — before/after are pixel-identical.