-
Notifications
You must be signed in to change notification settings - Fork 806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: newsletter toggle in editor sidebar has a visually broken active state #41036
Conversation
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
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 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Follow this PR Review Process:
Still unsure? 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -315,7 +315,7 @@ export function NewsletterEmailDocumentSettings() { | |||
const isSendEmailEnabled = useSelect( select => { | |||
const meta = select( editorStore ).getEditedPostAttribute( 'meta' ); | |||
// Meta value is negated, "don't send", but toggle is truthy when enabled "send" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether this comment is still necessary. Now that the toggle control value is a string, the code is more self-documenting IMO.
Fixes Automattic/wp-calypso#97139
The ToggleGroupControl component seems unhappy with a
false
value set in aToggleGroupControlOption
child component. Despite the value is false (and so the right value), theuseAnimatedOffsetRect
component does not calculate valid CSS variables used for animation but instead generates a:They should be similar to:
Once changed to two strings, it is working. I checked other places where the component is used, and it is working in the same way.
I don't consider this a Gutenberg bug but simply the component that does not accept falsy booleans, and I vote not to open a Gutenberg issue.
Registrazione.schermo.2025-01-14.alle.15.48.12.mov
Proposed changes:
true/false
values with"post-and-email"/"post-only"
stringstoggleSendEmail
andisSendEmailEnabled
to accept the new valuesOther information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
/wp-admin/admin.php?page=jetpack#newsletter
and switch on "Let visitors subscribe to this site and receive emails when you publish a post"Then you'll need to do two examples.
Submit the post with the selected "Post & email" and be sure to receive an email with the new post. Create another post with "Post only" selected, submit it, and be sure not to receive any email.