Skip to content

chore(Progress): Include OUIAProps for Progress#12576

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

chore(Progress): Include OUIAProps for Progress#12576
mshriver wants to merge 1 commit into
patternfly:mainfrom
mshriver:progress-ouia

Conversation

@mshriver

@mshriver mshriver commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Add OUIA attribute support to Progress for better test automation, and update dependent MultipleFileUploadStatusItem snapshots.

What:
Closes #12575

Additional issues:

Summary by CodeRabbit

  • New Features

    • Added Open UI Automation support to the Progress component.
    • Added options for custom component IDs and safe-mode configuration.
    • Progress now exposes standardized automation metadata.
  • Documentation

    • Documented Progress as an Open UI Automation-supported component.

Add OUIA attribute support to Progress for better test automation, and
update dependent MultipleFileUploadStatusItem snapshots.

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

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The Progress component now supports OUIA identifiers and safety attributes through typed props, default values, and root-element rendering. Tests cover custom and default OUIA values, and the OUIA documentation lists Progress.

Changes

Progress OUIA integration

Layer / File(s) Summary
Progress OUIA contract and rendering
packages/react-core/src/components/Progress/Progress.tsx
ProgressProps now includes OUIA properties, ouiaSafe defaults to true, and getOUIAProps adds OUIA attributes to the root element.
OUIA validation and documentation
packages/react-core/src/components/Progress/__tests__/Progress.test.tsx, packages/react-core/src/helpers/OUIA/OUIA.md
Tests verify custom IDs, component type, and safe-state attributes; the OUIA component list includes Progress.

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

Possibly related PRs

🚥 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 OUIAProps support to Progress.
Linked Issues check ✅ Passed The PR adds OUIA support to Progress and tests/docs that validate the new behavior, matching issue #12575.
Out of Scope Changes check ✅ Passed The visible changes are limited to Progress OUIA support, related tests, and docs, with no clear unrelated additions.
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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/react-core/src/components/Progress/__tests__/Progress.test.tsx (1)

112-115: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test the default ouiaId fallback behavior.

Consider adding a test case to verify that data-ouia-component-id successfully falls back to the generated ID (or idProp) when ouiaId is omitted, ensuring this default behavior is preserved in future refactors.

🧪 Proposed test addition
 test('Renders with custom ouiaId', () => {
   render(<Progress value={33} id="progress-ouia-id" ouiaId="test-id" title="Test" />);
   expect(document.getElementById('progress-ouia-id')).toHaveAttribute('data-ouia-component-id', 'test-id');
 });
+
+test('Renders with default ouiaId when omitted', () => {
+  render(<Progress value={33} id="progress-ouia-id-default" title="Test" />);
+  expect(document.getElementById('progress-ouia-id-default')).toHaveAttribute('data-ouia-component-id', 'progress-ouia-id-default');
+});
🤖 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/Progress/__tests__/Progress.test.tsx`
around lines 112 - 115, Add a test alongside “Renders with custom ouiaId” that
renders Progress without ouiaId and verifies data-ouia-component-id falls back
to the generated ID or provided idProp. Keep the assertion focused on the
component identified by the existing id and preserve the current custom-ouiaId
coverage.
🤖 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.

Inline comments:
In `@packages/react-core/src/components/Progress/Progress.tsx`:
- Line 157: Update the getOUIAProps call in Progress to pass ouiaId with id as
its fallback, ensuring the documented default generated component ID is provided
when ouiaId is omitted.

---

Nitpick comments:
In `@packages/react-core/src/components/Progress/__tests__/Progress.test.tsx`:
- Around line 112-115: Add a test alongside “Renders with custom ouiaId” that
renders Progress without ouiaId and verifies data-ouia-component-id falls back
to the generated ID or provided idProp. Keep the assertion focused on the
component identified by the existing id and preserve the current custom-ouiaId
coverage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: aa8e56ee-54e0-4a67-986b-2cfbc62d127f

📥 Commits

Reviewing files that changed from the base of the PR and between 8c89c01 and 778ae82.

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

className
)}
id={id}
{...getOUIAProps(Progress.displayName, ouiaId, ouiaSafe)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Implement the documented default behavior for ouiaId.

The documentation for ouiaId states that it is a "Value to overwrite the randomly generated data-ouia-component-id." However, because ouiaId is passed directly to getOUIAProps without a fallback, data-ouia-component-id will be completely missing from the rendered output when ouiaId is omitted.

To fix this, fall back to the id variable (which combines idProp and generatedId) so a default OUIA ID is always provided for the instance.

🐛 Proposed fix
-              {...getOUIAProps(Progress.displayName, ouiaId, ouiaSafe)}
+              {...getOUIAProps(Progress.displayName, ouiaId !== undefined ? ouiaId : id, ouiaSafe)}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{...getOUIAProps(Progress.displayName, ouiaId, ouiaSafe)}
{...getOUIAProps(Progress.displayName, ouiaId !== undefined ? ouiaId : id, 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/Progress/Progress.tsx` at line 157, Update
the getOUIAProps call in Progress to pass ouiaId with id as its fallback,
ensuring the documented default generated component ID is provided when ouiaId
is omitted.

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.

Progress missing OUIA support

1 participant