Skip to content

Search: migrate dashboard notices to @wordpress/ui Notice (depends on #48537)#48550

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

Search: migrate dashboard notices to @wordpress/ui Notice (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

@CGastrell CGastrell commented May 6, 2026

Fixes #

Important

Depends on #48537. Do not merge until #48537 has landed.
This branch is based on trunk. PR #48537 contains an interim Gridicon → @wordpress/icons migration of notice-action.jsx. This PR deletes that file outright. If this PR merges first, #48537 will conflict (and the interim swap there becomes meaningless). Merging in the order #48537 → this keeps the history of the wider Gridicon-removal sweep clean.

Proposed changes

Migrate the search dashboard's notice surface from the local SimpleNotice + NoticeAction wrappers to Notice.* from @wordpress/ui.

wp-ui-notice-after
  • record-meter/notice-box.jsx — tier notices use Notice.Root + Notice.Title + Notice.Description + Notice.Actions / Notice.ActionLink openInNewTab for the "Learn more" link. The legacy jp-search-notice-box__important class is replaced with intent="error", letting wp-ui handle the color/state via WPDS tokens.
  • pages/sections/first-run-section.jsx — indexing notice converted to Notice.Root + Title + Description.
  • global-notices/index.jsx — snackbar notices use Notice.Root + Notice.Description + Notice.CloseIcon, with auto-dismiss preserved via a small useEffect timer (replaces SimpleNotice's built-in duration prop). The redux store still ships is-info / is-success / is-warning / is-error status strings; they're mapped to wp-ui intents at render.
  • global-notices/store/actions.js — drops vestigial defaults (isCompact, isPersistent, displayOnNextPage) that no consumer ever read.

Deletions

  • notice/index.jsx (SimpleNotice — 130 lines, class component)
  • notice/notice-action.jsx (NoticeAction)
  • notice/style.scss (~270 lines of legacy dops-notice styling)
  • notice/test/index.test.jsx (tested SimpleNotice's dops-notice__icon-wrapper class)
  • record-meter/notice-box.scss (selectors only matched legacy markup)
  • Dead dops-notice overrides from global-notices/style.scss (snackbar positioning kept)

Bonus

Removes one site of @automattic/jetpack-components Gridicon usage (the icon inside SimpleNotice) — helps the broader #48160 modernization sweep.

Net diff

13 files, +72 / −681 lines. Single commit.

Related product discussion/links

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

No.

Testing instructions

Verified locally on a dev site after seeding a fake plan info option to bypass paid-plan gating:

  1. Tier notice (record-meter/notice-box) — surface the close-to-limit notice (e.g. recordCount in 80-99% of tierMaximumRecords) on the Jetpack Search admin page. Confirm:
    • Rounded notice with soft blue tint, info icon top-left.
    • "Learn more ↗" link opens in a new tab and includes an aria-label="(opens in a new tab)" indicator.
    • For tier-1 (data invalid), the notice renders with red/error intent automatically.
  2. First-run notice (first-run-section) — visible on a freshly licensed/uninitialized search dashboard. Should render with the same visual treatment as the tier notice but no actions.
  3. Global notices (global-notices) — trigger an action that dispatches successNotice, errorNotice, or updatingNotice (e.g. toggle a setting on the search settings page). Confirm:
    • Snackbar appears bottom-right.
    • Auto-dismisses after duration ms (default 2 s, updatingNotice 30 s).
    • Manual close via the X button works.
  4. Confirm no console errors or unstyled flashes.

A before/after of the tier-3 close-to-limit notice has been captured locally; happy to attach to the PR if reviewers want a visual.

@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?

Replace the local SimpleNotice + NoticeAction wrappers with Notice.* from
@wordpress/ui across the search dashboard:

- record-meter/notice-box: tier notices use Notice.Root/Title/Description
  + Notice.Actions/ActionLink (openInNewTab); the legacy
  jp-search-notice-box__important class becomes intent="error".
- pages/sections/first-run-section: indexing notice uses Notice.Root/Title/
  Description.
- global-notices: snackbar notices use Notice.Root + Notice.Description +
  Notice.CloseIcon, with auto-dismiss preserved via a useEffect timer.
  Status strings remain in the redux store; mapped to wp-ui intents at render.

Drops vestigial fields the redux notice creators never set anyway
(isCompact, isPersistent, displayOnNextPage, notice.button/href).

Deletes the SimpleNotice/NoticeAction sources, their stylesheets, and
notice-box.scss; strips the dead .dops-notice* overrides from
global-notices/style.scss while keeping the snackbar positioning rules.

Removes one site of @automattic/jetpack-components Gridicon usage
(SimpleNotice's icon-wrapper) — helps the broader modernization sweep.

Follow-up to simison review feedback on #48537.
@CGastrell CGastrell force-pushed the chore/search-notice-action-wp-ui-link branch from 53594a6 to b3c84b2 Compare May 6, 2026 13:47
@CGastrell CGastrell changed the title Search: migrate NoticeAction to @wordpress/ui Link (depends on #48537) Search: migrate dashboard notices to @wordpress/ui Notice (depends on #48537) May 6, 2026
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 [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants