Skip to content

feat(Drawer): Add full-size drawer - #12641

Open
rebeccaalpert wants to merge 1 commit into
patternfly:mainfrom
rebeccaalpert:drawer-fullsize
Open

feat(Drawer): Add full-size drawer#12641
rebeccaalpert wants to merge 1 commit into
patternfly:mainfrom
rebeccaalpert:drawer-fullsize

Conversation

@rebeccaalpert

@rebeccaalpert rebeccaalpert commented Sep 8, 2026

Copy link
Copy Markdown
Member

Use isViewport and place drawer below Page to achieve a full-height drawer that allows Page content to scroll behind it.

Fixes #12635

Summary by CodeRabbit

  • New Features

    • Added a beta viewport mode for drawers, allowing them to remain fixed and fill the viewport.
    • Added an interactive viewport drawer example with resizing, focus management, and page integration.
  • Bug Fixes

    • Improved drawer resizing behavior when content is omitted.
    • Clarified that drawer content may be optional.
  • Tests

    • Added coverage for viewport mode and keyboard interaction without drawer content.
  • Documentation

    • Documented the new viewport drawer option and usage example.

Use isViewport and place drawer below Page to achieve a full-height drawer that allows Page content to scroll behind it.

Fixes patternfly#12635
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c454c34a-8755-4feb-87b0-c067ece7f10d

📥 Commits

Reviewing files that changed from the base of the PR and between b73e9dd and 7a5801e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (11)
  • packages/react-core/package.json
  • packages/react-core/src/components/Drawer/Drawer.tsx
  • packages/react-core/src/components/Drawer/DrawerContent.tsx
  • packages/react-core/src/components/Drawer/DrawerPanelContent.tsx
  • packages/react-core/src/components/Drawer/__tests__/Drawer.test.tsx
  • packages/react-core/src/components/Drawer/examples/Drawer.md
  • packages/react-core/src/components/Drawer/examples/DrawerViewport.tsx
  • packages/react-docs/package.json
  • packages/react-icons/package.json
  • packages/react-styles/package.json
  • packages/react-tokens/package.json

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

The Drawer component adds the beta isViewport prop, updates resizing for drawers without content, adds tests, documents the viewport mode, and provides a complete viewport example. PatternFly prerelease references are updated across packages.

Changes

Drawer viewport support

Layer / File(s) Summary
Viewport prop and context wiring
packages/react-core/src/components/Drawer/Drawer.tsx, packages/react-core/src/components/Drawer/DrawerContent.tsx
Adds isViewport to the Drawer API and context, applies the viewport modifier, and documents optional drawer content.
Viewport sizing and regression coverage
packages/react-core/src/components/Drawer/DrawerPanelContent.tsx, packages/react-core/src/components/Drawer/__tests__/Drawer.test.tsx
Selects drawerRef for viewport sizing and retains drawerContentRef for other drawers. Tests cover the modifier and resizing without drawer content.
Viewport example and package alignment
packages/react-core/src/components/Drawer/examples/*, packages/*/package.json
Adds the viewport documentation and example. Updates PatternFly prerelease references from 6.6.0-prerelease.39 to 6.6.0-prerelease.41.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 7a580

This adds viewport Drawer positioning and empty-content resize support with accompanying examples and regression coverage. No merge-blocking risk is currently identified.

Sequence Diagram(s)

sequenceDiagram
  participant Page
  participant Drawer
  participant DrawerContext
  participant DrawerPanelContent
  participant DrawerElement
  Page->>Drawer: renders with isViewport
  Drawer->>DrawerContext: provides viewport state and refs
  Drawer->>DrawerElement: applies viewport modifier
  DrawerPanelContent->>DrawerContext: reads viewport state and refs
  DrawerPanelContent->>DrawerElement: measures selected sizing element
Loading

Suggested reviewers: kmcfaul, mcoker

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: adding full-size Drawer support.
Linked Issues check ✅ Passed The changes satisfy the linked issue objectives. They add the viewport Drawer prop and modifier, support optional Drawer content during context, ref, and resize operations, add the required viewport e…
Out of Scope Changes check ✅ Passed The reviewed changes are within scope. They implement viewport Drawer support, update related documentation and examples, add tests, and align PatternFly dependency versions with the feature.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 5…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adjust drawer to support new page work - React

1 participant