Tooltip migration: boot consumers + shell-level Tooltip.Provider (5/5)#78692
Conversation
…ended Now that the in-repo migration of `Tooltip` consumers from `@wordpress/components` to `@wordpress/ui` is complete (PRs #78411, #78466, #78470, #78691, #78692), this PR flips the recommendation: - `@wordpress/eslint-plugin` (`use-recommended-components`): - Adds `Tooltip` to the `@wordpress/ui` allow-list. - Adds a `Tooltip` entry to the `@wordpress/components` deny-list pointing to `Tooltip` from `@wordpress/ui`. - `@wordpress/components` Storybook story: flips `componentStatus.status` from `recommended` to `not-recommended` and adds a `notes` field pointing to `@wordpress/ui`. - `@wordpress/ui` Storybook story: flips `componentStatus.status` from `use-with-caution` to `recommended` and drops the previous compat caveat (resolved by #78441). - Removes the per-import `// eslint-disable-next-line @wordpress/use-recommended-components` directives that were added during the migration in PRs 1-3 (20 files across `block-editor`, `block-directory`, `editor`, `edit-post`, `edit-site`, and `dataviews`). Note: this PR is based on trunk and therefore does NOT yet remove the analogous directives added by PRs 4 and 5 (#78691, #78692). Once those merge, this PR will be rebased and the remaining directives removed in the same commit.
|
Size Change: +32.3 kB (+0.4%) Total Size: 8.21 MB 📦 View Changed
ℹ️ View Unchanged
|
c5faea5 to
4f0cb32
Compare
|
Flaky tests detected in 768be18. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/26571550753
|
| ease: 'easeOut', | ||
| } } | ||
| className="boot-layout__sidebar-backdrop" | ||
| <Tooltip.Provider> |
There was a problem hiding this comment.
This is the only change in the file, the rest is whitespace / formatting
4f0cb32 to
59a4387
Compare
| { label } | ||
| </Button> | ||
| </WCTooltip> | ||
| <Tooltip.Root> |
There was a problem hiding this comment.
Immediately after a save, hover the "Saved" button — tooltip shows only the keyboard shortcut (no extra left-indent).
| <SiteIcon /> | ||
| </Link> | ||
| </WCTooltip> | ||
| <Tooltip.Root> |
Migrates the two `Tooltip` consumers in `@wordpress/boot` from the legacy `Tooltip` exported by `@wordpress/components` to the compositional `Tooltip` exported by `@wordpress/ui`, and mounts a shell-level `<Tooltip.Provider>` inside `boot/root` so tooltips inside the app coordinate as a group (mirrors PR #78466 for edit-post and edit-site layouts). - `boot/site-icon-link` — codemod-able. Tooltip on the site-icon `Link`, positioned to the right. - `boot/save-button` — migrated by hand because the legacy `shortcut` prop has no equivalent on the new `Tooltip`. The shortcut is rendered inline inside `Tooltip.Popup` via a local `.boot-save-button__shortcut` span (mirroring the legacy `.components-tooltip__shortcut` rule from `@wordpress/components`, but with a local class name to avoid leaking the `components-*` namespace outside `@wordpress/components`). A `TODO` flags the intent to replace this with a future `@wordpress/ui` `Shortcut` primitive once available. `@wordpress/ui` is now declared as a runtime dependency of `@wordpress/boot`. Part 5 of a 5-PR migration series (PRs 1-3 landed: #78411, #78466, #78470; PR 4 is in flight).
59a4387 to
768be18
Compare
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
The codemod was introduced in #78411 to assist the 5-PR migration of the `Tooltip` component from `@wordpress/components` to `@wordpress/ui` (#78411, #78466, #78470, #78691, #78692). With the migration complete, the codemod has no remaining utility. The `tools/codemods/` directory is removed entirely because no other codemods remained.
The codemod was introduced in #78411 to assist the 5-PR migration of the `Tooltip` component from `@wordpress/components` to `@wordpress/ui` (#78411, #78466, #78470, #78691, #78692). With the migration complete, the codemod has no remaining utility. The `tools/codemods/` directory is removed entirely because no other codemods remained. --- Co-authored-by: ciampo <[email protected]> Co-authored-by: manzoorwanijk <[email protected]>


What?
Tooltip migration part 5 of 5 (final): migrates the 2
Tooltipconsumers in@wordpress/bootfrom the legacyTooltip(@wordpress/components) to the compositionalTooltip(@wordpress/ui), plus mounts a shell-level<Tooltip.Provider>insideboot/rootso sibling tooltips coordinate as a group (mirrors #78466 foredit-post/edit-site).Sites migrated
boot/components/site-icon-link— codemod output; tooltip on the site-iconLink, positioned to the right.boot/components/save-button— manual migration (the codemod bails on the legacyshortcutprop). The shortcut renders inline insideTooltip.Popupas a local.boot-save-button__shortcutspan; CSS mirrors the legacycomponents-tooltip__shortcutrule (left-margin only when a label sits to its left). An inlineTODOflags a future@wordpress/uiShortcutprimitive.boot/components/root— shell-level<Tooltip.Provider>inside<SlotFillProvider>.5-PR plan
block-editor + block-directory (+ codemod)— Tooltip migration: block-editor + block-directory consumers (1/5) #78411 landededitor + edit-post + edit-site— Tooltip migration: editor + edit-post + edit-site consumers (2/5) #78466 landeddataviews— Tooltip migration: dataviews consumers (3/5) #78470 landedsave-button+ shell-levelTooltip.Provider) ← this PRFollow-ups: codemod cleanup (#78669), mark
Tooltiprecommended (after this PR).Why?
With this PR, all consumers outside
@wordpress/componentsitself are migrated — unlocking the recommendation flip in a follow-up.Out of scope
Call sites inside
@wordpress/components(notablyButton's internal Tooltip andTooltipInternalContext) stay on the legacy implementation — separate follow-up.How?
site-icon-linkwas rewritten by the codemod from #78411; import placement and the per-lineeslint-disabledirective were finished by hand.save-buttonwas done by hand because the codemod intentionally bails on the legacyshortcutprop. The shortcut is rendered as a sibling inside<Tooltip.Popup>with a local class name; CSS replicates the legacymargin-left: $grid-unit-10(gated on:not(:first-child)so a lonely shortcut — in the saved state — stays flush left, mirroring the legacy conditional class).The shell-level
<Tooltip.Provider>sits inside<SlotFillProvider>, matching the placement used byedit-post/edit-siteshells. Once the first tooltip in a session has been shown, subsequent siblings open instantly within the same provider scope.@wordpress/uiwas added as a runtime dependency to@wordpress/boot.Testing Instructions
boot/root).aria-label.Testing Instructions for Keyboard
Keyboard focus on the save button still announces the visible label +
aria-keyshortcuts. The visible tooltip is hover-only — no change vs trunk in keyboard interaction.Screenshots or screencast
Inline review comments on each call site include before/after snapshots where useful.
Use of AI Tools
This PR was authored with assistance from Cursor; the author reviewed and verified all changes.