Skip to content

My Jetpack: migrate overview Button and Text to @wordpress/ui#48166

Merged
CGastrell merged 1 commit into
trunkfrom
try/my-jetpack-overview-wp-ui
May 22, 2026
Merged

My Jetpack: migrate overview Button and Text to @wordpress/ui#48166
CGastrell merged 1 commit into
trunkfrom
try/my-jetpack-overview-wp-ui

Conversation

@lezama
Copy link
Copy Markdown
Contributor

@lezama lezama commented Apr 18, 2026

Partial of #48160 — My Jetpack dashboard section.

Proposed changes

Per-page migration pass on the My Jetpack overview page (/wp-admin/admin.php?page=my-jetpack#/overview): swap safe Text and Button usages from @automattic/jetpack-components to @wordpress/ui v0.11.0. Adds @wordpress/ui to the my-jetpack package dependencies at the version already used by sibling packages (forms, newsletter, publicize, charts, components).

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

No

Files migrated (9)

Text → @wordpress/ui Text with variant mapping (bodybody-md, body-smallbody-sm, labelbody-sm, title-mediumheading-lg):

  • packages/my-jetpack/_inc/components/connected-product-card/index.tsx
  • packages/my-jetpack/_inc/components/product-card/status.tsx
  • packages/my-jetpack/_inc/components/connection-status-card/index.tsx
  • packages/my-jetpack/_inc/components/card/index.jsx
  • packages/my-jetpack/_inc/components/plans-section/index.tsx (Text only — Buttons left for follow-up)
  • packages/my-jetpack/_inc/components/product-cards-section/backup-card/index.jsx
  • packages/my-jetpack/_inc/components/product-cards-section/videopress-card/index.tsx
  • packages/my-jetpack/_inc/components/product-cards-section/contextual-card-info.jsx

Button → @wordpress/ui Button (variant="secondary""outline"):

  • packages/my-jetpack/_inc/components/product-card/recommendation-actions.tsx

Other information

  • Generate changelog entries for this PR (using AI).

Out of scope (follow-up PRs)

  • action-button/index.tsx + action-button/secondary-button.tsx — pervasive href/isExternalLink/weight — needs coordinated Link migration
  • plans-section/index.tsx Button usages — all variant="link" + href + isExternalLink + weight="regular" (inline TODO at top of file)
  • golden-token/tooltip/index.tsxvariant="link"
  • connection-status-card/index.tsx variant="link" Button — kept on @wordpress/components
  • Interstitial flow files — not on overview render path
  • Col/Container → Stack, Gridicon → @wordpress/icons, and per-component migrations (JetpackIcon, JetpackLogo, LoadingPlaceholder, Notice, Spinner, UpsellBanner, GlobalNotices, DotPager, ThemeProvider) — separate PRs per issue Jetpack UI Modernization #48160

Real-screen before / after

Both screenshots captured on a live Jurassic Ninja site with Jetpack connected. Before = clean trunk rebuild (54cb1b001a). After = this branch's build with the migrations applied.

Before (trunk, rebuilt) After (this PR)
before after

Both renders are pixel-identical (739,707 bytes each). DOM verification on the branch build: __body-md, __body-sm, __heading-lg, __is-neutral classes confirmed present — migration is live. No layout/visual regressions.

Investigated an earlier visual "regression" I thought I saw in the Views chart — turned out to be a transient Stats-widget render state in my very first trunk screenshot (chart bars displayed at a larger relative height during initial data load). Subsequent renders of both trunk and this branch are identical. My PR does not affect the Stats widget.

Notes on the migration

  1. Build order matters: pnpm jetpack build packages/my-jetpack --production must run before pnpm jetpack build plugins/jetpack --production — the plugin build bundles pre-built package outputs, so package changes need to be refreshed first.
  2. Version parity: pinned @wordpress/ui at 0.11.0 to match forms, newsletter, publicize, charts, and js-packages/components. A version mismatch would cause pnpm to resolve two copies and their CSS module hashes to differ.
  3. Text semantic change: @automattic/jetpack-components Text renders title-medium<h3>, body<p>, etc. @wordpress/ui Text always renders <span>. Callsites on the overview page do not rely on block-level defaults, so no layout impact observed, but this is a consideration for future migrations of files where the variant was carrying block-level styling.

Testing instructions

  • Visit My Jetpack overview (admin.php?page=my-jetpack#/overview).
  • Verify product cards, plan section, and connection status card render identically to trunk.
  • Confirm no console errors.
  • Spot-check Text typography and Button appearance in the admin.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 18, 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), and enable the try/my-jetpack-overview-wp-ui branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack try/my-jetpack-overview-wp-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

github-actions Bot commented Apr 18, 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 Apr 18, 2026
@jp-launch-control
Copy link
Copy Markdown

jp-launch-control Bot commented Apr 18, 2026

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

@lezama lezama force-pushed the try/my-jetpack-overview-wp-ui branch 7 times, most recently from af92d08 to f6e1037 Compare April 18, 2026 20:21
@keoshi
Copy link
Copy Markdown
Contributor

keoshi commented May 7, 2026

Looks good to me, even though the screenshots above appear broken.

One thing to note is that this change seems to revert the fix we applied recently to the button in the connection page:

image

@CGastrell CGastrell force-pushed the try/my-jetpack-overview-wp-ui branch from f6e1037 to 2d1bed2 Compare May 19, 2026 21:20
@CGastrell CGastrell added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels May 19, 2026
@CGastrell CGastrell marked this pull request as ready for review May 19, 2026 21:22
@CGastrell CGastrell self-assigned this May 19, 2026
@CGastrell
Copy link
Copy Markdown
Contributor

Hey @lezama — a few updates on this branch:

  1. Rebased onto current trunk. Branch was 12 days behind and DIRTY. Conflicts on pnpm-lock.yaml, plans-section/index.tsx, and backup-card/index.jsx — all import-line resolutions: kept both Link (from trunk's Use Link instead of ExternalLink #48529 sweep) and Text (from your migration) in the @wordpress/ui imports; lockfile took trunk's, no new deps needed. Rebased commit: df7f69b.

  2. @keoshi's flagged regression is resolved by the rebase. The "missing background on Supercharge my site button" turned out to be stale-branch drift, not an active revert by this PR. My Jetpack: fix missing background on "Supercharge my site" button #48240 landed on trunk after the PR was opened and connection-form.tsx was never touched by this branch — so the rebase pulls in trunk's variant="primary" automatically. Verified locally on a connected dev site (button renders with the correct primary fill on the rebased branch).

  3. Bumped @wordpress/ui to 0.13.0 on packages/my-jetpack (was 0.11.0). The overview Button + Text migration this PR introduces consumes the same @wordpress/ui surface the rest of the modernization work is consolidating onto. Commit: 2d1bed2.

You're welcome to take it over the merge line, or leave it with us and we'll watch CI / shepherd it through — whichever you prefer. No pressure either way.

Comment thread projects/packages/my-jetpack/package.json Outdated
@CGastrell CGastrell force-pushed the try/my-jetpack-overview-wp-ui branch 2 times, most recently from df7f69b to 5251520 Compare May 20, 2026 13:59
@CGastrell CGastrell force-pushed the try/my-jetpack-overview-wp-ui branch from 5251520 to c3694b8 Compare May 22, 2026 12:48
@CGastrell CGastrell merged commit 4fa6aa9 into trunk May 22, 2026
90 checks passed
@CGastrell CGastrell deleted the try/my-jetpack-overview-wp-ui branch May 22, 2026 13:08
@github-actions github-actions Bot removed [Status] Needs Review This PR is ready for review. [Status] In Progress labels May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants