Tooltip migration: boot consumers + shell-level Tooltip.Provider (5/5)#78692
Draft
ciampo wants to merge 1 commit into
Draft
Tooltip migration: boot consumers + shell-level Tooltip.Provider (5/5)#78692ciampo wants to merge 1 commit into
ciampo wants to merge 1 commit into
Conversation
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).
ciampo
added a commit
that referenced
this pull request
May 26, 2026
…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
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Final part of a 5-PR series migrating
Tooltipconsumers from@wordpress/componentsto the new compositionalTooltipin@wordpress/ui.This PR:
Tooltipconsumers in@wordpress/boot.<Tooltip.Provider>insideboot/rootso tooltips inside the app coordinate as a group — mirrors what Tooltip migration: editor + edit-post + edit-site consumers (2/5) #78466 did foredit-postandedit-sitelayouts.Sites migrated in this PR
boot/components/site-icon-link— codemod-able. Tooltip on the site-iconLink, positioned to the right.boot/components/save-button— migrated by hand because the legacyshortcutprop has no equivalent on the newTooltip. The shortcut is rendered inline insideTooltip.Popupvia a local.boot-save-button__shortcutspan (mirroring the legacy.components-tooltip__shortcutrule from@wordpress/components, but with a local class name to avoid leaking thecomponents-*namespace outside@wordpress/components). An inlineTODOflags the intent to replace this with a future@wordpress/uiShortcutprimitive once available.Plus:
<Tooltip.Provider>mounted insideboot/root's<SlotFillProvider>wrapper.Full 5-PR plan
block-editor + block-directory (also lands the codemod)— Tooltip migration: block-editor + block-directory consumers (1/5) #78411 ✅ landededitor + edit-post + edit-site (+ shell-level Tooltip.Provider)— Tooltip migration: editor + edit-post + edit-site consumers (2/5) #78466 ✅ landeddataviews— Tooltip migration: dataviews consumers (3/5) #78470 ✅ landedPlus follow-ups:
@wordpress/uiTooltip as recommended in the ESLint rule + Storybook (in flight; depends on this PR)Why?
The new compositional API is the future for tooltips across the repo. With this PR, all consumers outside `@wordpress/components` itself have been migrated, unlocking the recommendation flip in a follow-up.
Note
Call sites inside
@wordpress/components(notablyButton's internal Tooltip andTooltipInternalContext) stay on the legacy implementation — tracked as a separate follow-up.How?
`site-icon-link` was rewritten by the jscodeshift codemod landed in #78411; import placement and the per-line
eslint-disable @wordpress/use-recommended-componentsdirective were finished by hand.`save-button` was done by hand because the codemod intentionally bails on the legacy
shortcutprop. The replacement renders the shortcut as a sibling element inside<Tooltip.Popup>with a local class name; CSS replicates the legacymargin-left: \$grid-unit-10rule.The shell-level
<Tooltip.Provider>sits inside<SlotFillProvider>, matching the placement used bypackages/edit-post/src/components/layout/index.js(andedit-sitelikewise). This means: once the first tooltip in a session has been shown, subsequent siblings open instantly within the same provider scope.`@wordpress/ui` is now declared as a runtime dependency of `@wordpress/boot`.
Testing Instructions
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.