Skip to content

Forms: replace links with Link component from @wordpress/ui. - #48407

Merged
simison merged 6 commits into
trunkfrom
update/forms-external-links-ui
May 18, 2026
Merged

simison merged 6 commits into
trunkfrom
update/forms-external-links-ui

Conversation

@simison

@simison simison commented Apr 30, 2026 •

Copy link
Copy Markdown
Member

Replace all bare <a> and <ExternalLink> usages from @wordpress/components with the Link component from @wordpress/ui using the openInNewTab prop for links opened in a new tab.

Part of #48160

Proposed changes

  • Replace <a href> with <Link>
  • Replace <ExternalLink> with <Link>
  • Open links to new tabs in the Akismet integration card only when in editor context; otherwise, it's fine to open in the same browser tab.

Related product discussion/links

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

Testing instructions

At the Forms dashboard:

  • see integrations modal and see links e.g. under Akismet look consistent regardless if they open in new tab or not.
  • see that in response panel, links to preview files, url fields and email fields look good and work well

Before

Screenshot 2026-04-30 at 12 31 11 Screenshot 2026-04-30 at 12 31 25

After

Screenshot 2026-04-30 at 12 26 29 image

@simison
simison requested review from CGastrell and dhasilva April 30, 2026 09:50
@simison simison added Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Forms [Status] Needs Review This PR is ready for review. [Package] Forms labels Apr 30, 2026
@github-actions

github-actions Bot commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

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), and enable the update/forms-external-links-ui branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/forms-external-links-ui

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

@github-actions

Copy link
Copy Markdown
Contributor

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 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!

@jp-launch-control

jp-launch-control Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Code Coverage Summary

This 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. 🤷

Full summary · PHP report · JS report

@simison

simison commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

Note that the next version of @wordpress/components in the latest Gutenberg and later in WP 7.1 will update the styles of ExternalLink to match those of Link, so the tiny divergence in styles while we have a mix of ExternalLink and Link will go away.

Note also that there are style updates to Link in latest wordpress/ui, incoming in another PR.

@simison

simison commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

Whoop, we need to fix the i18n issue in bundles. Same solution as for DataViews should work:

ERROR in editor.js:5:60: domain argument (index 2) is missing: (0,i.__)("(opens in a new tab)")

@simison

simison commented Apr 30, 2026

Copy link
Copy Markdown
Member Author

Hmm, odd, i18n issues should already be handled by this:

// Add textdomains (but no other optimizations) for @wordpress/dataviews and @wordpress/ui.
const textdomainsOnly = TranspileRule( {
includeNodeModules: [ '@wordpress/dataviews/', '@wordpress/ui/' ],
exclude: dataviewsWp.include,
babelOpts: {
configFile: false,
plugins: [
[ require.resolve( '@automattic/babel-plugin-replace-textdomain' ), { textdomain } ],
],
},
} );

@simison
simison force-pushed the update/forms-external-links-ui branch 2 times, most recently from daca61f to 7715758 Compare May 12, 2026 14:50
@simison

simison commented May 12, 2026

Copy link
Copy Markdown
Member Author

rebased after #48529 merged

@simison
simison force-pushed the update/forms-external-links-ui branch from b5e3657 to b3a802c Compare May 16, 2026 09:38
@simison
simison force-pushed the update/forms-external-links-ui branch from b3a802c to 0e4267f Compare May 18, 2026 18:58
@simison
simison merged commit a2005a0 into trunk May 18, 2026
71 checks passed
@simison
simison deleted the update/forms-external-links-ui branch May 18, 2026 19:23
@github-actions github-actions Bot removed the [Status] Needs Review This PR is ready for review. label May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Contact Form Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Feature] Contact Form [Feature] Forms [Package] Forms

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant