Skip to content

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

Merged

Conversation

mmtr
Copy link
Member

@mmtr mmtr commented Jun 10, 2025

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

Before After
Screen.Recording.2025-06-10.at.16.50.00.mov
Screen.Recording.2025-06-10.at.17.05.14.mov

Tags

Before After
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:

SEO Block guide
Screenshot 2025-06-10 at 17 07 00 Screenshot 2025-06-10 at 17 06 36

Other information:

  • Have you written new tests for your changes, if applicable?
  • Have you checked the E2E test CI results, and verified that your changes do not break them?
  • Have you tested your changes on WordPress.com, if applicable (if so, you'll see a generated comment below with a script to run)?

Jetpack product discussion

N/A

Does this pull request change what data or activity we track or use?

No

Testing instructions:

  • Apply these changes to your WP.com site
  • Go to the post editor
  • Open the post settings sidebar
  • Open the Except panel
  • Click on the "Learn more about manual excerpts" link
  • Make sure the support article is opened in the Help Center
  • Open the Tags panel now
  • Click on the "Build your audience with tags" link
  • Make sure the support article is opened in the Help Center
  • Open the Jetpack settings sidebar
  • Open the SEO panel
  • Click on the "Learn more about the SEO feature" link
  • Make sure there are no regressions, and the support article keeps opening in the Help Center
  • Insert an embed block
  • Open the block settings sidebar
  • Observe the block description
  • Click on the "Block guide" link
  • Make sure there are no regressions, and the support article keeps opening in the Help Center

Copy link
Contributor

github-actions bot commented Jun 10, 2025

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add a "[Type]" label (Bug, Enhancement, Janitorial, Task).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

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:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

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:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: July 1, 2025
    • Code freeze: June 30, 2025

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@github-actions github-actions bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jun 10, 2025
@mmtr mmtr added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Jun 10, 2025
Copy link
Contributor

github-actions bot commented Jun 10, 2025

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the dotsup-57-master-list-open-support-links-in-help-center-modal branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack dotsup-57-master-list-open-support-links-in-help-center-modal
bin/jetpack-downloader test jetpack-mu-wpcom-plugin dotsup-57-master-list-open-support-links-in-help-center-modal

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

Copy link

jp-launch-control bot commented Jun 10, 2025

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/extensions/plugins/ai-content-lens/extend/ai-post-excerpt/index.tsx 0/70 (0.00%) 0.00% -1 💚
projects/plugins/jetpack/extensions/plugins/seo/components/upsell.js 0/12 (0.00%) 0.00% -5 💚

1 file is newly checked for coverage.

File Coverage
projects/js-packages/shared-extension-utils/src/components/wpcom-support-link.jsx 0/9 (0.00%) 💔

Full summary · PHP report · JS report

Coverage check overridden by I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. .

@rcrdortiz rcrdortiz requested a review from Copilot June 10, 2025 16:32
Copy link
Contributor

@Copilot Copilot AI left a 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' ) } />

Copy link
Member

@alshakero alshakero left a 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.

* @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 } ) {
Copy link
Contributor

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 :) ?

Copy link
Member Author

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 to className like in Calypso) is also convenient because that way we don't need to change how the assets files are built for the wpcom-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.

Copy link
Contributor

@BogdanUngureanu BogdanUngureanu Jun 11, 2025

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.

Copy link
Member Author

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.

Copy link
Contributor

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. 😄

Copy link
Member

@alshakero alshakero left a 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:

  1. 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?
  2. The "Block guide" phrase is not translated, probably because it's new.

@mmtr
Copy link
Member Author

mmtr commented Jun 11, 2025

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?

It's easier if you test this on a Simple site with a Free plan.

The "Block guide" phrase is not translated, probably because it's new.

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

@mmtr mmtr added the I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. label Jun 12, 2025
@mmtr mmtr merged commit f8d762d into trunk Jun 12, 2025
76 checks passed
@mmtr mmtr deleted the dotsup-57-master-list-open-support-links-in-help-center-modal branch June 12, 2025 08:09
@github-actions github-actions bot added this to the jetpack/14.8 milestone Jun 12, 2025
@github-actions github-actions bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jun 12, 2025
mmtr added a commit to Automattic/wp-calypso that referenced this pull request Jun 13, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Extension] AI Content Lens [Extension] SEO I don't care about code coverage for this PR Use this label to ignore the check for insufficient code coveage. [JS Package] Shared Extension Utils [mu wpcom Feature] Tags Education [mu wpcom Feature] Wpcom Block Description Links [Package] Jetpack mu wpcom WordPress.com Features [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants