[ui] Tooltip: Default portal container to the wp compat overlay slot#78095
Conversation
|
Flaky tests detected in 0b5ab9d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/25807760468
|
51511ba to
175a123
Compare
|
Size Change: +534 B (+0.01%) Total Size: 7.96 MB 📦 View Changed
ℹ️ View Unchanged
|
9ae3d4a to
360b1fb
Compare
360b1fb to
5ddc222
Compare
271e9fb to
0b5ab9d
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. |
0b5ab9d to
1f4767d
Compare
Compresses JSDoc, inline comments, prose, and README copy added by #77851, #78095, and #78183 down to the essentials. Public API docs keep the "what / when / two opt-in paths" guidance; internal narration and implementation reasoning that the code already conveys is dropped or compressed. No behavior changes.
Mirrors the Tooltip wiring from #78095: `Select.Portal` defaults its `container` to the `@wordpress/ui` compat overlay slot, so select popups (including `SelectControl`, which wraps `Select` internally) stack reliably above `@wordpress/components` overlays in mixed-library compositions. A caller-supplied `Select.Portal` `container` prop continues to take precedence.
…78372) * [ui] Select: Default portal container to the wp compat overlay slot Mirrors the Tooltip wiring from #78095: `Select.Portal` defaults its `container` to the `@wordpress/ui` compat overlay slot, so select popups (including `SelectControl`, which wraps `Select` internally) stack reliably above `@wordpress/components` overlays in mixed-library compositions. A caller-supplied `Select.Portal` `container` prop continues to take precedence. * [ui] Select: Add PR number to CHANGELOG entry --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]>
…slot Mirrors the Tooltip wiring from #78095 (and the Select wiring from `@wordpress/ui` compat overlay slot, so autocomplete popups stack reliably above `@wordpress/components` overlays in mixed-library compositions. A caller-supplied `Autocomplete.Portal` `container` prop continues to take precedence.
…slot (#78375) * [ui] Autocomplete: Default portal container to the wp compat overlay slot Mirrors the Tooltip wiring from #78095 (and the Select wiring from `@wordpress/ui` compat overlay slot, so autocomplete popups stack reliably above `@wordpress/components` overlays in mixed-library compositions. A caller-supplied `Autocomplete.Portal` `container` prop continues to take precedence. * [ui] Autocomplete: Add PR number to CHANGELOG entry --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]>
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…ents` Adds `Tooltip` to the `@wordpress/ui` allowlist used by the `use-recommended-components` rule. Without this, consumers migrating from the legacy `@wordpress/components` `Tooltip` to the new compositional `@wordpress/ui` `Tooltip` (built on base-ui, introduced in #78095) would trip the rule on every migrated call site.
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…ents` Adds `Tooltip` to the `@wordpress/ui` allowlist used by the `use-recommended-components` rule. Without this, consumers migrating from the legacy `@wordpress/components` `Tooltip` to the new compositional `@wordpress/ui` `Tooltip` (built on base-ui, introduced in #78095) would trip the rule on every migrated call site.
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…ents` Adds `Tooltip` to the `@wordpress/ui` allowlist used by the `use-recommended-components` rule. Without this, consumers migrating from the legacy `@wordpress/components` `Tooltip` to the new compositional `@wordpress/ui` `Tooltip` (built on base-ui, introduced in #78095) would trip the rule on every migrated call site.
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…ents` Adds `Tooltip` to the `@wordpress/ui` allowlist used by the `use-recommended-components` rule. Without this, consumers migrating from the legacy `@wordpress/components` `Tooltip` to the new compositional `@wordpress/ui` `Tooltip` (built on base-ui, introduced in #78095) would trip the rule on every migrated call site.
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…ents` Adds `Tooltip` to the `@wordpress/ui` allowlist used by the `use-recommended-components` rule. Without this, consumers migrating from the legacy `@wordpress/components` `Tooltip` to the new compositional `@wordpress/ui` `Tooltip` (built on base-ui, introduced in #78095) would trip the rule on every migrated call site.
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…ents` Adds `Tooltip` to the `@wordpress/ui` allowlist used by the `use-recommended-components` rule. Without this, consumers migrating from the legacy `@wordpress/components` `Tooltip` to the new compositional `@wordpress/ui` `Tooltip` (built on base-ui, introduced in #78095) would trip the rule on every migrated call site.
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
#78095 (the new @wordpress/ui Tooltip API).
…8411) Migrates 7 consumer call sites in `@wordpress/block-directory` and `@wordpress/block-editor` from the legacy `Tooltip` exported by `@wordpress/components` to the compositional `Tooltip` exported by `@wordpress/ui` (built on top of base-ui under the hood): - block-directory/downloadable-block-list-item - block-editor/block-patterns-list (WithToolTip) - block-editor/global-styles/shadow-panel-components - block-editor/inserter/media-tab/media-preview - block-editor/inspector-controls-tabs - block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up) - block-editor/preset-input-control/custom-value-controls Also lands the jscodeshift codemod used to perform the mechanical rewrite across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js): npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \ --extensions=js,jsx,ts,tsx --parser=tsx \ packages/<scope> Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod; group-coordination is handled by shell-level `<Tooltip.Provider>`s mounted in the edit-post / edit-site / boot PRs. Part of the broader migration tracked in #78095 (the new @wordpress/ui Tooltip API). --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]>
…8411)
Migrates 7 consumer call sites in `@wordpress/block-directory` and
`@wordpress/block-editor` from the legacy `Tooltip` exported by
`@wordpress/components` to the compositional `Tooltip` exported by
`@wordpress/ui` (built on top of base-ui under the hood):
- block-directory/downloadable-block-list-item
- block-editor/block-patterns-list (WithToolTip)
- block-editor/global-styles/shadow-panel-components
- block-editor/inserter/media-tab/media-preview
- block-editor/inspector-controls-tabs
- block-editor/list-view/block-select-button (non-interactive trigger; flagged for a11y follow-up)
- block-editor/preset-input-control/custom-value-controls
Also lands the jscodeshift codemod used to perform the mechanical rewrite
across all 5 PRs of the migration (tools/codemods/tooltip-components-to-ui.js):
npx jscodeshift -t tools/codemods/tooltip-components-to-ui.js \
--extensions=js,jsx,ts,tsx --parser=tsx \
packages/<scope>
Per-call-site `Tooltip.Provider`s are *not* introduced by the codemod;
group-coordination is handled by shell-level `<Tooltip.Provider>`s
mounted in the edit-post / edit-site / boot PRs.
Part of the broader migration tracked in
WordPress/gutenberg#78095 (the new @wordpress/ui Tooltip API).
---
Co-authored-by: ciampo <[email protected]>
Co-authored-by: mirka <[email protected]>
Source: WordPress/gutenberg@96fa2d3
What?
Wires
Tooltip.Portal'scontainerto default to the wp compat overlay slot from #77851. End-to-end validator for the slot infrastructure: with this in place,@wordpress/uiTooltips stack reliably above@wordpress/componentsoverlays in mixed-library compositions, with no per-instance plumbing.A caller-supplied
Tooltip.Portalcontainercontinues to take precedence. No behavior change for@wordpress/ui-only consumers.Testing Instructions
Unit
npx jest --config=test/unit/jest.config.js --testPathPattern='packages/ui/src/tooltip/test/index'Expected: 8 passing (5 pre-existing + 3 new under
wp compat overlay slot).Storybook (cross-library stacking)
Open Playground / WP Compat Overlay Slot / Tooltip inside @wordpress/components Modal. Click Open Modal, hover Hover me: the
@wordpress/uiTooltip popup renders above the Modal, portaled into[data-wp-compat-overlay-slot]. Same for the Popover story.In any other (un-decorated) story — e.g. Design System / Components / Tooltip / Default — confirm the dormant baseline: the popup uses the default portal container and
[data-wp-compat-overlay-slot]is absent from the DOM.Editor (auto-detect, real consumer)
The slot auto-detects
window.wp.components, which is on the global in the WordPress editor. To exercise the wiring end-to-end against a real editor consumer, swap an existing@wordpress/componentsTooltipusage for a@wordpress/uione.Example patch — Inspector Controls tabs
Then
npm run dev, open a post in the editor, select a block (for example, the Image block), and hover the icon-only tabs at the top of the Inspector Controls sidebar (Settings / Styles / List View). The tab tooltips are now@wordpress/uiTooltips; in DevTools, confirm they portal into[data-wp-compat-overlay-slot]ondocument.body.Files touched
packages/ui/src/tooltip/portal.tsx— the wiring itself.packages/ui/src/tooltip/test/index.test.tsx— 3 new integration tests under awp compat overlay slotdescribe block. Opt-in tests render a wrapper component that callsuseEnableWpCompatOverlaySlot(), mirroring real-consumer usage rather than poking at the internal flag.packages/ui/README.md— documentsuseEnableWpCompatOverlaySlot()under a new "Mixing with@wordpress/components" subsection.storybook/stories/playground/wp-compat-overlay-slot.story.jsx— cross-library demo.storybook/stories/playground/with-wp-compat-overlay-slot.tsx— Storybook decorator that flips the gate during the playground story's lifetime. Kept private to the playground (not shared across per-component stories) because the opt-in flag is process-wide onwindow, and applying the decorator to per-component stories would leak the gate into sibling stories rendered on the same Storybook autodocs page.Next Steps
Wire the rest of
@wordpress/ui's overlays the same way in subsequent PRs..components-draggable__clonemigrates onto the slot in #78183 so an active drag stays above it.Use of AI Tools
Authored with Cursor (Claude). Author reviewed all changes.