Skip to content

Search: migrate NoticeAction to @wordpress/ui Link (depends on #48537)#48550

Open
CGastrell wants to merge 1 commit intotrunkfrom
chore/search-notice-action-wp-ui-link
Open

Search: migrate NoticeAction to @wordpress/ui Link (depends on #48537)#48550
CGastrell wants to merge 1 commit intotrunkfrom
chore/search-notice-action-wp-ui-link

Conversation

@CGastrell
Copy link
Copy Markdown
Contributor

Fixes #

Important

Depends on #48537. Do not merge until #48537 has landed.
This branch is based on trunk, which still uses Gridicon in notice-action.jsx. PR #48537 contains an interim migration of the same file from @automattic/jetpack-components Gridicon to @wordpress/icons. If this PR merges first, #48537 will conflict (and the interim swap there becomes redundant). Merging in order — #48537 first, then this — keeps history clean and the interim swap meaningful within the wider Gridicon-removal sweep.

Proposed changes

  • Migrate projects/packages/search/src/dashboard/components/notice/notice-action.jsx to use <Link openInNewTab> from @wordpress/ui. The new component:
    • sets target="_blank" automatically when external is true,
    • appends an "(opens in a new tab)" arrow indicator () with a screen-reader label, and
    • lets the existing a.dops-notice__action SCSS keep full styling control (variant="unstyled").
  • Remove the now-unused icon prop. No in-package consumer was passing it, and no external module imports NoticeAction from this package.
  • Strip three .gridicon SCSS blocks under a.dops-notice__action that targeted the old inline <Gridicon> (default 18px, >480px 24px, compact 14px). Without the inline icon they were dead.
  • Add @wordpress/ui@0.11.0 to the search package dependencies (matches the version pinned by my-jetpack, publicize, forms, boost, etc.).
  • Net notice-action.jsx: 40 → 26 lines (also removes one @automattic/jetpack-components import site, which helps the broader #48160 modernization).

Related product discussion/links

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

No.

Testing instructions

  1. On a site with Jetpack Search enabled, surface a record-meter notice that includes the "Learn more" link (e.g. exceed ~80% of the indexed-records ceiling for the current tier so the tier-3 close-to-maximum notice renders, or temporarily force notice-box.jsx to render the tier-3 case).
  2. Confirm the link still opens in a new tab and is followed by an arrow indicator immediately after the text.
  3. Confirm the link's color, font-size, padding, and hover state are unchanged from a.dops-notice__action styling (no brand-blue tint or auto-underline from @wordpress/ui Link defaults — variant="unstyled" keeps existing styling intact).
  4. Confirm screen readers announce "(opens in a new tab)".
  5. (Optional) Repeat for the global-notices path (global-notices/index.jsx) where external is unset — the link should still render, with no arrow indicator.

Replace the custom anchor + Gridicon "external" pattern with
`<Link openInNewTab>` from `@wordpress/ui`, which sets `target="_blank"`,
adds an "(opens in a new tab)" screen-reader label, and renders the
external indicator arrow automatically.

Drops the now-unused `icon` prop (no in-package consumer was passing it),
removes three dead `.gridicon` SCSS blocks under `a.dops-notice__action`,
and removes one site of `@automattic/jetpack-components` Gridicon usage.

Follow-up to simison review feedback on #48537.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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 chore/search-notice-action-wp-ui-link branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack chore/search-notice-action-wp-ui-link
bin/jetpack-downloader test jetpack-mu-wpcom-plugin chore/search-notice-action-wp-ui-link

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 github-actions Bot added the [Package] Search Contains core Search functionality for Jetpack and Search plugins label May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

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!

@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 May 6, 2026
@CGastrell CGastrell added [Status] In Progress 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 May 6, 2026
@jp-launch-control
Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 1 file.

File Coverage Δ% Δ Uncovered
projects/packages/search/src/dashboard/components/notice/notice-action.jsx 4/4 (100.00%) 0.00% 0 💚

Full summary · PHP report · JS report

@simison
Copy link
Copy Markdown
Member

simison commented May 6, 2026

Does it make sense to keep basic components in Search like notice, instead of just deleting the whole component and replacing with wp-ui Notice where needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Search Contains core Search functionality for Jetpack and Search plugins [Status] In Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants