Newsletter menu: do not display when not connected to WordPress.com#47927
Newsletter menu: do not display when not connected to WordPress.com#47927
Conversation
On self-hosted and WoW sites, we should only display the menu item if folks can use the toggles in there, i.e. if the site is connected.
|
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
Code Coverage SummaryCoverage changed in 1 file.
17 files are newly checked for coverage. Only the first 5 are listed here.
Full summary · PHP report · JS report If appropriate, add one of these labels to override the failing coverage check:
Covered by non-unit tests
|
Add Settings_Test to verify that the newsletter admin menu is not registered when the site is not connected to WordPress.com, and that it is registered at the correct priority when connected.
|
Following our discussion at p1775228718136869/1775224746.641709-slack-C03NLNTPZ2T I implemented a check to ensure we display the page appropriately when the site is connected, but has not connected admin yet. Just like for the legacy Jetpack > Settings > Newsletter page, I added:
This was done in 926bd62 |
mehmoodak
left a comment
There was a problem hiding this comment.
This looks much better now. Thanks for the improvements.
Tested the changes and noted following things:
pointer-events: noneis not working and click events are passing through to what's beneath.- Elements can be toggled even when they appear as disabled ... previously in Newsletter tab it was not possible to toggle them.
- More tests for this additional code would be nice 🙂
Screen.Recording.2026-04-03.at.9.49.56.PM.mov
Fix the disabled overlay for non-connected users: use pointer-events: all to block clicks, wrap settings in <Disabled> for defense-in-depth, adjust overlay opacity to 0.6 and extend it to cover the section border. Add Jest tests verifying the connect notice and disabled state render correctly based on connection status.
|
Thanks for the review, good catches. I just pushed 6f00df8 to hopefully address all that feedback. |
mehmoodak
left a comment
There was a problem hiding this comment.
Testing well, thanks for doing all the extra work on top of a simple fix. Change looks much better now.
See #47927 (comment) Co-authored-by: Mehmood Ahmad <31419912+mehmoodak@users.noreply.github.com>



Fixes NL-577
Proposed changes
On self-hosted and WoW sites, there are 2 additional use-cases we need to take into account when displaying the Newsletter submenu and the Newsletter settings page:
Other information
Related product discussion/links
na
Does this pull request change what data or activity we track or use?
no
Testing instructions