Skip to content

chore(Drawer): Include OUIAProps for Drawer - #12580

Open
mshriver wants to merge 2 commits into
patternfly:mainfrom
mshriver:drawer-ouia
Open

chore(Drawer): Include OUIAProps for Drawer#12580
mshriver wants to merge 2 commits into
patternfly:mainfrom
mshriver:drawer-ouia

Conversation

@mshriver

@mshriver mshriver commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Add OUIA attribute support to Drawer for better test automation.

What: Closes #12579

Summary by CodeRabbit

  • New Features

    • Added Open UI Automation attributes to the Drawer component.
    • Drawer now supports custom automation IDs and configurable automation safety settings.
    • Added Drawer to the Open UI Automation component documentation.
  • Tests

    • Added coverage validating Drawer automation attributes and default behavior.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 52a8aabf-8367-4e64-83cb-69f2643535e3

📥 Commits

Reviewing files that changed from the base of the PR and between 759a598 and 0b8163a.

⛔ Files ignored due to path filters (3)
  • packages/react-core/src/components/Compass/__tests__/__snapshots__/Compass.test.tsx.snap is excluded by !**/*.snap
  • packages/react-core/src/components/Compass/__tests__/__snapshots__/CompassContent.test.tsx.snap is excluded by !**/*.snap
  • packages/react-core/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • packages/react-core/src/components/Drawer/Drawer.tsx
  • packages/react-core/src/components/Drawer/__tests__/Drawer.test.tsx
  • packages/react-core/src/helpers/OUIA/OUIA.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/react-core/src/components/Drawer/tests/Drawer.test.tsx
  • packages/react-core/src/helpers/OUIA/OUIA.md
  • packages/react-core/src/components/Drawer/Drawer.tsx

Walkthrough

Drawer now supports OUIA props, renders OUIA data attributes on its root element, tests the behavior, and lists Drawer in the OUIA documentation.

Changes

Drawer OUIA integration

Layer / File(s) Summary
OUIA props and rendering
packages/react-core/src/components/Drawer/Drawer.tsx, packages/react-core/src/components/Drawer/__tests__/Drawer.test.tsx, packages/react-core/src/helpers/OUIA/OUIA.md
DrawerProps now supports ouiaId and ouiaSafe. The component generates OUIA props and applies them to its root element. Tests cover the generated attributes, and the OUIA component list includes Drawer.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: thatblindgeye, rebeccaalpert

🚥 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 summarizes the main change: adding OUIA props support to the Drawer component, which aligns directly with the changeset's primary objective.
Linked Issues check ✅ Passed The pull request fulfills all requirements: OUIA props support added to Drawer component via OUIAProps extension, test automation enabled through OUIA attributes, and comprehensive tests verify both custom and default OUIA behavior.
Out of Scope Changes check ✅ Passed All changes directly support OUIA integration for Drawer: component implementation, test coverage, and documentation updates are within scope of the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/react-core/src/components/Drawer/Drawer.tsx (1)

71-71: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider adding a fallback string for the component type.

Since Drawer.displayName is typed as string | undefined on React.FunctionComponent, passing it directly to useOUIAProps (which expects a strict string) could cause a TypeScript error depending on project strictness settings. It could also result in an unwanted PF6/undefined type if the displayName property gets stripped during minification.

Providing a static fallback string ensures a valid, stable ouiaComponentType is always generated.

♻️ Proposed refactor
-  const ouiaProps = useOUIAProps(Drawer.displayName, ouiaId, ouiaSafe);
+  const ouiaProps = useOUIAProps(Drawer.displayName || 'Drawer', ouiaId, ouiaSafe);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/react-core/src/components/Drawer/Drawer.tsx` at line 71, Update the
useOUIAProps call in Drawer to pass a stable literal fallback when
Drawer.displayName is undefined, ensuring the component type is always a strict,
non-empty string and never generates PF6/undefined.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/react-core/src/components/Drawer/Drawer.tsx`:
- Line 71: Update the useOUIAProps call in Drawer to pass a stable literal
fallback when Drawer.displayName is undefined, ensuring the component type is
always a strict, non-empty string and never generates PF6/undefined.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 204f2c03-8c1e-4e34-830a-33b0c6dfd3ea

📥 Commits

Reviewing files that changed from the base of the PR and between 7519afe and d3a8a4a.

⛔ Files ignored due to path filters (1)
  • packages/react-core/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (3)
  • packages/react-core/src/components/Drawer/Drawer.tsx
  • packages/react-core/src/components/Drawer/__tests__/Drawer.test.tsx
  • packages/react-core/src/helpers/OUIA/OUIA.md

@rebeccaalpert
rebeccaalpert self-requested a review July 22, 2026 17:36

@rebeccaalpert rebeccaalpert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouia stuff looks good, but tests are failing. Would you mind taking a look?

@rebeccaalpert rebeccaalpert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much!

mshriver and others added 2 commits August 6, 2026 09:18
Add OUIA attribute support to Drawer for better test automation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

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.

Drawer missing OUIA Support

2 participants