-
Notifications
You must be signed in to change notification settings - Fork 853
Social: Open upgrade and demo links in new tab to preserve editor context #46891
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
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 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
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.
Pull request overview
Updates Jetpack Social upgrade notices so the “Upgrade now” and “View demo” CTAs open in a new tab, keeping the block editor session intact.
Changes:
- Replace
Noticeactionsusage with manually rendered link-styleButtoncomponents usinghref,target="_blank", andrel. - Remove autosave-and-redirect behavior and related styling that supported the old
actionslayout. - Add a Publicize package changelog entry for the behavior change.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| projects/packages/publicize/changelog/update-social-improve-upgrade-buttons | Adds changelog entry documenting the upgrade/demo CTA behavior change. |
| projects/packages/publicize/_inc/components/form/upgrade-notice.tsx | Renders upgrade + demo CTAs as links opening in a new tab within the notice body. |
| projects/packages/publicize/_inc/components/form/upgrade-notice-customization.tsx | Renders customization upgrade CTA as a link opening in a new tab; removes notice action styling usage. |
| projects/packages/publicize/_inc/components/form/styles.module.scss | Removes now-unused customization notice action styling. |
projects/packages/publicize/_inc/components/form/upgrade-notice.tsx
Outdated
Show resolved
Hide resolved
projects/packages/publicize/_inc/components/form/upgrade-notice-customization.tsx
Outdated
Show resolved
Hide resolved
projects/packages/publicize/changelog/update-social-improve-upgrade-buttons
Show resolved
Hide resolved
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
gmjuhasz
left a comment
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.
Checking either the demo or considering upgrade, it opens in a new tab 👍
Fixes SOCIAL-343
Proposed changes:
This PR improves the upgrade flow by opening upgrade and demo links in a new tab instead of navigating away from the editor.
Changes:
target="_blank"), preserving the editor context so users don't lose their workuseAutosaveAndRedirect(which navigates away) to standard link buttons with properhrefattributesactionsprop with manually rendered buttons using Flex layout, as the actions prop doesn't support all necessary button props (see Gutenberg issue #74090)useAutosaveAndRedirecthook,clsximport, and custom stylesOther information:
Jetpack product discussion
SOCIAL-343
Does this pull request change what data or activity we track or use?
No changes to data tracking.
Testing instructions:
Create or edit a post as a user without a paid Jetpack Social plan
Open the Jetpack Social panel in the editor sidebar
Click the "Upgrade now" button in the upgrade notice
Verify: The upgrade page opens in a new tab, and your editor remains open with unsaved changes preserved
Click the "View demo" button
Verify: The demo page opens in a new tab and scrolls to the video on the social landing page
Test both upgrade notices:
Sidebar

Preview modal
