Skip to content

feat: add unique OUIA ID to feedback home title#306

Merged
catastrophe-brandon merged 1 commit intoRedHatInsights:masterfrom
catastrophe-brandon:btweed/feedback-ouia-ids
May 1, 2026
Merged

feat: add unique OUIA ID to feedback home title#306
catastrophe-brandon merged 1 commit intoRedHatInsights:masterfrom
catastrophe-brandon:btweed/feedback-ouia-ids

Conversation

@catastrophe-brandon
Copy link
Copy Markdown
Contributor

Summary

Adds unique OUIA component ID to the feedback home page title to enable reliable test automation.

Changes

Added data-ouia-component-id="feedback-home-title" to the "Tell us about your experience" heading in the feedback home page.

Problem Solved

Prevents strict mode violations in Playwright tests caused by duplicate auto-generated OUIA IDs:

  • Before: OUIA-Generated-Content-14 and OUIA-Generated-Content-3 (duplicates)
  • After: feedback-home-title (unique, stable ID)

Testing

Enables tests to use:

page.locator('[data-ouia-component-id="feedback-home-title"]')

Instead of:

page.getByText('Tell us about your experience') // causes strict mode error

Related

Required for feedback test migration PR #305

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 2bfa51ae-7e1e-4a87-b0d8-c6503e5d5e70

📥 Commits

Reviewing files that changed from the base of the PR and between 87ce532 and b3ac87f.

📒 Files selected for processing (1)
  • src/components/HelpPanel/HelpPanelTabs/Feedback/FeedbackPanel.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/components/HelpPanel/HelpPanelTabs/Feedback/FeedbackPanel.tsx

Summary by CodeRabbit

  • Tests
    • Added stable UI identifiers to the feedback page header to improve automated UI test reliability.
    • This change reduces test flakiness and supports more consistent end-to-end and integration testing without altering the user experience.

Walkthrough

Added OUIA attributes (ouiaId="feedback-home-title" and ouiaSafe) to the Content header (ContentVariants.h1) in the FeedbackPanel to provide a stable UI/test automation selector.

Changes

Cohort / File(s) Summary
OUIA attributes on feedback header
src/components/HelpPanel/HelpPanelTabs/Feedback/FeedbackPanel.tsx
Updated the feedback home header Content element (using ContentVariants.h1) to include ouiaId="feedback-home-title" and ouiaSafe attributes for deterministic UI/test selection.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a unique OUIA ID to the feedback home title for test automation purposes.
Description check ✅ Passed The description includes a clear summary of changes, the problem being solved, testing instructions, and related context, but lacks screenshots section and incomplete checklist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@catastrophe-brandon catastrophe-brandon marked this pull request as ready for review May 1, 2026 16:43
@catastrophe-brandon catastrophe-brandon self-assigned this May 1, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/HelpPanel/HelpPanelTabs/Feedback/FeedbackPanel.tsx`:
- Around line 133-138: The Content heading currently only sets
data-ouia-component-id; update the Content component in FeedbackPanel (the
element rendering intl.formatMessage(messages.tellAboutExperience)) to include
the OUIA type as well — either add
data-ouia-component-type="feedback-home-title" alongside the existing
data-ouia-component-id or, preferably, use PatternFly's ouiaId and
ouiaComponentType props (ouiaId="feedback-home-title"
ouiaComponentType="feedback-home-title") on that Content element to achieve full
OUIA:Component compliance.
🪄 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: Enterprise

Run ID: 6773639a-7f35-44a9-819a-c193e2d6c7bb

📥 Commits

Reviewing files that changed from the base of the PR and between a4e519e and 87ce532.

📒 Files selected for processing (1)
  • src/components/HelpPanel/HelpPanelTabs/Feedback/FeedbackPanel.tsx

Comment on lines +133 to 138
<Content
component={ContentVariants.h1}
data-ouia-component-id="feedback-home-title"
>
{intl.formatMessage(messages.tellAboutExperience)}
</Content>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Does the OUIA (OpenShift UI Automation) framework require both data-ouia-component-id and data-ouia-component-type attributes?

💡 Result:

Yes, the OUIA (Open UI Automation) framework requires both data-ouia-component-id and data-ouia-component-type attributes for components to be OUIA:Component compliant.

Citations:


🌐 Web query:

Does PatternFly React Content component support custom data attributes like data-ouia-component-id?

💡 Result:

Yes, the PatternFly React Content component supports custom data attributes like data-ouia-component-id. It explicitly provides ouiaId and ouiaSafe props that control data-ouia-component-id and data-ouia-safe attributes, respectively. PatternFly components generally forward additional props, including custom data-* attributes, to the rendered DOM element. The Content component is listed as OUIA-compliant in the official documentation.

Citations:


Add data-ouia-component-type attribute to achieve OUIA compliance.

The data-ouia-component-id attribute alone is insufficient. OUIA standards require both data-ouia-component-id and data-ouia-component-type for full OUIA:Component compliance. Add data-ouia-component-type="feedback-home-title" to the Content component, or use PatternFly's dedicated ouiaId prop as the preferred approach:

<Content
  component={ContentVariants.h1}
  ouiaId="feedback-home-title"
  ouiaComponentType="feedback-home-title"
>
  {intl.formatMessage(messages.tellAboutExperience)}
</Content>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/HelpPanel/HelpPanelTabs/Feedback/FeedbackPanel.tsx` around
lines 133 - 138, The Content heading currently only sets data-ouia-component-id;
update the Content component in FeedbackPanel (the element rendering
intl.formatMessage(messages.tellAboutExperience)) to include the OUIA type as
well — either add data-ouia-component-type="feedback-home-title" alongside the
existing data-ouia-component-id or, preferably, use PatternFly's ouiaId and
ouiaComponentType props (ouiaId="feedback-home-title"
ouiaComponentType="feedback-home-title") on that Content element to achieve full
OUIA:Component compliance.

Add data-ouia-component-id="feedback-home-title" to the 'Tell us
about your experience' heading to enable unique identification in
automated tests and avoid strict mode violations from duplicate
auto-generated OUIA IDs.
@catastrophe-brandon catastrophe-brandon force-pushed the btweed/feedback-ouia-ids branch from 87ce532 to b3ac87f Compare May 1, 2026 16:55
@catastrophe-brandon catastrophe-brandon merged commit 4100b96 into RedHatInsights:master May 1, 2026
9 checks passed
@catastrophe-brandon catastrophe-brandon deleted the btweed/feedback-ouia-ids branch May 1, 2026 17:05
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.

2 participants