Skip to content

chore(Drawer): Include OUIAProps for Drawer#12580

Open
mshriver wants to merge 1 commit into
patternfly:mainfrom
mshriver:drawer-ouia
Open

chore(Drawer): Include OUIAProps for Drawer#12580
mshriver wants to merge 1 commit 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.

Add OUIA attribute support to Drawer for better test automation.

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

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

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
DrawerProps now supports ouiaId and ouiaSafe; the component generates OUIA props and spreads them onto the root element.
Validation and documentation
packages/react-core/src/components/Drawer/__tests__/Drawer.test.tsx, packages/react-core/src/helpers/OUIA/OUIA.md
Tests verify OUIA component ID, type, and safe attributes, while the OUIA component list includes Drawer.

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

Possibly related PRs

Suggested reviewers: tlabaj

🚥 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 and concisely summarizes the main change: adding OUIAProps support to Drawer.
Linked Issues check ✅ Passed Drawer now supports OUIA props and tests/docs were updated, matching the issue's automation support goal.
Out of Scope Changes check ✅ Passed The test and OUIA docs updates are directly related to the Drawer OUIA support change.
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?

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