Search: migrate NoticeAction to @wordpress/ui Link (depends on #48537)#48550
Search: migrate NoticeAction to @wordpress/ui Link (depends on #48537)#48550
Conversation
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.
|
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! |
Code Coverage SummaryCoverage changed in 1 file.
|
|
Does it make sense to keep basic components in Search like |
Fixes #
Important
Depends on #48537. Do not merge until #48537 has landed.
This branch is based on
trunk, which still uses Gridicon innotice-action.jsx. PR #48537 contains an interim migration of the same file from@automattic/jetpack-componentsGridicon 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
projects/packages/search/src/dashboard/components/notice/notice-action.jsxto use<Link openInNewTab>from@wordpress/ui. The new component:target="_blank"automatically whenexternalis true,↗) with a screen-reader label, anda.dops-notice__actionSCSS keep full styling control (variant="unstyled").iconprop. No in-package consumer was passing it, and no external module importsNoticeActionfrom this package..gridiconSCSS blocks undera.dops-notice__actionthat targeted the old inline<Gridicon>(default 18px,>480px24px, compact 14px). Without the inline icon they were dead.@wordpress/ui@0.11.0to the search package dependencies (matches the version pinned bymy-jetpack,publicize,forms,boost, etc.).notice-action.jsx: 40 → 26 lines (also removes one@automattic/jetpack-componentsimport 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
notice-box.jsxto render the tier-3 case).a.dops-notice__actionstyling (no brand-blue tint or auto-underline from@wordpress/uiLink defaults —variant="unstyled"keeps existing styling intact).global-notices/index.jsx) whereexternalis unset — the link should still render, with no arrow indicator.