UI Dialog: Add Description, modal context, and misc improvements#77194
Draft
UI Dialog: Add Description, modal context, and misc improvements#77194
Conversation
ciampo
added a commit
that referenced
this pull request
Apr 9, 2026
- Add useDeprioritizedInitialFocus to Drawer.Popup so the close icon is not the first focused element when the drawer opens - Add data-wp-ui-drawer-close-icon attribute to Drawer.CloseIcon - Add container prop to Drawer.Popup and Dialog.Popup for cross-document portal rendering - Align Drawer.Action disabled/loading handling with Dialog.Action - Revert Card.Title changes (moved to #77187) - Extract Dialog improvements to separate PR (#77194) - Fix CHANGELOG placeholder PR number Made-with: Cursor
|
Size Change: 0 B Total Size: 7.74 MB ℹ️ View Unchanged
|
|
Flaky tests detected in ec51c53. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24206969924
|
- Add Dialog.Description sub-component wrapping Base UI's Dialog.Description with the Text component (variant="body-md") - Add DialogModalContext so Popup can conditionally render the backdrop only when modal === true (previously always rendered) - Extract --viewport-inset CSS variable for consistent viewport padding - Add onOpenChangeComplete to RootProps - Move component description from Storybook params to Root JSDoc Split from #76690. Made-with: Cursor
18f1122 to
ec51c53
Compare
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?
Split from #76690 (Drawer primitive PR).
Adds several improvements to the
Dialogcomponent that were originally bundled with the Drawer PR.Why?
These changes are independent of the Drawer implementation and are better reviewed and merged separately to keep the Drawer PR focused.
How?
New sub-component:
Dialog.DescriptionDialog.Descriptionwith theTextcomponent (variant="body-md")DescriptionPropstype, barrel export, CSS (.descriptionrule), story subcomponent entry, and ref forwarding testModal context + conditional backdrop
DialogModalContext/DialogModalProvider/useDialogModaltocontext.tsxDialog.Rootchildren in the provider soPopupcan read themodalvalue<Dialog.Backdrop>conditional onmodal === true(previously always rendered)CSS refactor
--wpds-dimension-padding-2xlused inwidthandmax-heightcalculations into a--viewport-insetCSS custom property, matching the Drawer's approachType + docs
onOpenChangeCompletetoDialog.RootPropsparameters.docs.description.componentto a JSDoc block on theRootfunctionTesting Instructions
npm run storybook:devmodal={false}no longer renders a backdrop overlaynpm run test:unit packages/ui/src/dialog— all tests should passUse of AI Tools
Cursor + Claude Opus 4.6
Made with Cursor