-
Notifications
You must be signed in to change notification settings - Fork 821
Post editor: Open support links in Help Center #43883
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
Post editor: Open support links in Help Center #43883
Conversation
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! 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. |
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 2 files.
1 file is newly checked for coverage.
Full summary · PHP report · JS report Coverage check overridden by
I don't care about code coverage for this PR
|
… need fixing before
projects/js-packages/shared-extension-utils/src/components/wpcom-support-link.jsx
Outdated
Show resolved
Hide resolved
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
This PR updates the post editor to open WP.com support links in the Help Center and refactors support link components to ensure a consistent approach across the codebase.
- Refactored support link usage to use the new reusable WpcomSupportLink component.
- Updated multiple components and changelogs to redirect support links directly to the Help Center.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
projects/plugins/jetpack/extensions/plugins/seo/components/upsell.js | Replaced manual Help Center logic with WpcomSupportLink for SEO upsell support links. |
projects/plugins/jetpack/extensions/plugins/ai-content-lens/extend/ai-post-excerpt/index.tsx | Updated Docs link logic to use WpcomSupportLink for atomic/simple sites and ExternalLink otherwise. |
projects/plugins/jetpack/changelog/dotsup-57-master-list-open-support-links-in-help-center-modal | Added changelog entry reflecting the Help Center support articles change. |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-block-description-links/src/description-support-link.tsx | Updated inline support link component to use WpcomSupportLink. |
projects/packages/jetpack-mu-wpcom/src/features/wpcom-block-description-links/index.tsx | Adjusted import path to the updated description support link component. |
projects/packages/jetpack-mu-wpcom/src/features/tags-education/tags-education.js | Replaced ExternalLink with WpcomSupportLink for tags education support links. |
projects/packages/jetpack-mu-wpcom/changelog/dotsup-57-master-list-open-support-links-in-help-center-modal | Updated changelog entry for tags education. |
projects/js-packages/shared-extension-utils/src/components/wpcom-support-link.jsx | New component that centralizes support link behavior. |
projects/js-packages/shared-extension-utils/src/components/index.js | Updated export to include WpcomSupportLink. |
projects/js-packages/shared-extension-utils/changelog/dotsup-57-master-list-open-support-links-in-help-center-modal | Added changelog entry for the new WpcomSupportLink component. |
Comments suppressed due to low confidence (1)
projects/plugins/jetpack/extensions/plugins/ai-content-lens/extend/ai-post-excerpt/index.tsx:233
- [nitpick] Consider using localizeUrl for the URL instead of the __() function to maintain consistency with other parts of the codebase that use localizeUrl for support links.
<WpcomSupportLink url={ __( 'https://wordpress.com/support/excerpts/', 'jetpack' ) } postId={ 1569 } text={ __( 'Learn more about manual excerpts', 'jetpack' ) } />
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.
Looks great and will make the experience much better. Found one issue that will probably create a bug.
...jetpack-mu-wpcom/src/features/wpcom-block-description-links/src/description-support-link.tsx
Show resolved
Hide resolved
projects/js-packages/shared-extension-utils/src/components/wpcom-support-link.jsx
Outdated
Show resolved
Hide resolved
* @param {object} [props.style] - CSS properties to be applied to the link. | ||
* @return {React.JSX.Element} The component to render. | ||
*/ | ||
export function WpcomSupportLink( { url, postId, text, onClick, style } ) { |
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.
There's an InlineSupportLink
component in Calypso that, I believe, does the same thing. if we can't share it, can we at least have an equivalent component with the same props and behavior :) ?
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.
Yeah, it cannot be re-used because it relies on Calypso state.
I can make it more similar, but it won't be 1:1 equivalent:
- The Calypso component supports more scenarios like a more granular control over the text and the icon, but that's not needed so far in Jetpack.
- I'm also reluctant to adding a generic event tracking to the component like in Calypso, because Jetpack is already tracking events for some of the links outside of the component, but they all use a different event name, so we cannot consolidate that inside the component.
- Adding support for the
style
prop (as opposed toclassName
like in Calypso) is also convenient because that way we don't need to change how the assets files are built for thewpcom-block-description-links
feature. - The Jetpack component lives in the shared extensions package which is used by both Jetpack and WPCOM (I initially added it to jetpack-mu-wpcom, but that doesn't work in the SEO panel logic that is implemented in Jetpack-the-plugin). However, the link only works on WPCOM sites, so I intentionally wanted to include a
wpcom
mention in both the file and the component name. This will make cause the component to have a different naming than in Calypso.
Said that, I renamed some of the properties, so they are similar to the Calypso ones, and also added support for children components like in Calypso.
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 also reluctant to adding a generic event tracking to the component like in Calypso, because Jetpack is already tracking events for some of the links outside of the component, but they all use a different event name, so we cannot consolidate that inside the component.
Yes, but that means if we want to see how many clicks have for the help center, we'll have to do an audit of all of these events and maintain that list. Having a generic event would be a lot easier to keep track of and it would be consistent with the behavior we have in Calypso.
Plus, in some scenarios tracking a specific event doesn't always mean that the help center will be opened: the example is the ai-post-excerpt
from this PR where for Jetpack sites we don't open the HC.
But first, @escapemanuele do you happen to know if we even care about these events (to be more exact, is someone interested in these values)? :D
However, the link only works on WPCOM sites
Does it make sense to have a component that works for Jetpack too? But instead of opening the HC, it just opens the external link?
This way, if we ever want to ship HC to Jetpack, we don't need to audit the code again.
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.
if we want to see how many clicks have for the help center
if we ever want to ship HC to Jetpack
Two big ifs in there 😄 I'm not a fan of early abstractions and implementing logic for use cases we don't need yet.
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.
haha. But tbf, the first one is more about consistency. We trigger those in Calypso, it would make sense to have it in Jetpack too. 😄
projects/js-packages/shared-extension-utils/src/components/wpcom-support-link.jsx
Show resolved
Hide resolved
…ivalent to the Calypso counterpart
...jetpack-mu-wpcom/src/features/wpcom-block-description-links/src/description-support-link.tsx
Show resolved
Hide resolved
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.
Tested all the steps in English and Arabic and everything worked as expected. The Help Center opens and the right article of the appropriate locale opens 🪄
Notes:
- I couldn't manage to see the upsell "To use the SEO feature...". Not sure how you got an Atomic site without a business plan?
- The "Block guide" phrase is not translated, probably because it's new.
It's easier if you test this on a Simple site with a Free plan.
It's not new, since the link already exists in production. Actually, it's also displayed untranslated in production, so it looks like a symptom of something else. Asked in p1749653988642659-slack-C02AED43D |
…t-open-support-links-in-help-center-modal
Updates the Help Center app for WP Admin so any support link with a `data-target="wpcom-help-center"` attribute is opened in the Help Center directly rather than in a new tab. This is useful for cases where React is not available and therefore we cannot use the `WpcomSupportLink` component introduced in Automattic/jetpack#43883.
Fixes DOTSUP-46
Fixes DOTSUP-67
Proposed changes:
This PR ensures that a couple of support links in the post editor are opened directly in the Help Center rather than on a new tab.
Excerpts
Screen.Recording.2025-06-10.at.16.50.00.mov
Screen.Recording.2025-06-10.at.17.05.14.mov
Tags
Screen.Recording.2025-06-10.at.17.05.32.mov
Screen.Recording.2025-06-10.at.17.05.52.mov
It also refactors another couple of links that were already opening the support articles in the Help Center, so they all use the same React component:
Other information:
Jetpack product discussion
N/A
Does this pull request change what data or activity we track or use?
No
Testing instructions: