Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: Comment |
PR Summary by QodoFCN-667: Adopt PatternFly FormSection for wizard sections
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Section omits its UI guidance note
|
| @@ -1,4 +1,4 @@ | |||
| import { Content, Form, Split, SplitItem, Stack } from '@patternfly/react-core'; | |||
| import { Content, Form, FormSection, Split, SplitItem, Stack } from '@patternfly/react-core'; | |||
There was a problem hiding this comment.
1. Section omits its ui guidance note 📘 Rule violation ⚙ Maintainability
Section.tsx begins with the PatternFly import instead of a file-level comment referencing docs/agent-rules/ui-component.md. Because this modified UI component has no pointer to its applicable guidance, later changes can overlook the component-specific conventions documented there.
Agent Prompt
## Issue description
The modified `Section.tsx` component lacks the required top-level reference to `docs/agent-rules/ui-component.md`.
## Fix Focus Areas
- packages/nxtcm-rosa-hcp-wizard/src/components/Section.tsx[1-1]
## Recommended Fix
Insert a file-level comment referencing `docs/agent-rules/ui-component.md` before the first import, making it the first non-empty line.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| if (isForm) { | ||
| return ( | ||
| <Form onSubmit={(e) => e.preventDefault()}> | ||
| <FormSection id={id} title={formSectionTitle}> |
There was a problem hiding this comment.
Now that I look at the code I think the ticket is misleading. (Sorry, I created it, I should've done a better analysis).
FormSection should be used to break down long forms into smaller sections. This happens only in the "Roles and policies" step of the wizard. For the rest of the wizard Section is used only once per step, just to add a Title and a wrapping Form. These are two separate use cases that should not be mixed.
If you agree I think we should use Section (maybe we could use better naming given html also as a section tag) just to wrap each step of the wizard. The title can be just a Title in a Content block outside the form in this case.
We can then use plain FormSections in the Roles step and avoid having two separate forms inside of it, which is weird.
There was a problem hiding this comment.
looks good visually now. the Cluster details / Roles / Machine pool titles are back to heading-xs, and Review still lines up with the YAML button.
I agree with @kelvah on the structure though. FormSection is for splitting a long form, which is only the Roles step and everywhere else Section is just a step title plus a wrapping Form. Mixing those in one component is going to keep biting us.
I’d rather Section stay the step wrapper (title outside the form is fine), and Roles be one Form with two plain FormSections. right now that step still mounts two forms.
There was a problem hiding this comment.
Yes, that makes sense, I agree. I'll try to rework it that way.
| <Stack> | ||
| <Split hasGutter> | ||
| <SplitItem isFilled> | ||
| <div className="rosa-hcp-section__title pf-v6-u-w-100"> | ||
| {label} | ||
| {idProp && ( | ||
| <LabelHelp id={idProp} labelHelp={labelHelp} labelHelpTitle={labelHelpTitle} /> | ||
| )} | ||
| </div> | ||
| </SplitItem> | ||
| {labelActions ? <SplitItem>{labelActions}</SplitItem> : null} | ||
| </Split> | ||
| {description && ( | ||
| <Content component="small" className="pf-v6-u-pt-sm"> | ||
| {description} | ||
| </Content> | ||
| )} | ||
| {sectionHeader} | ||
| {sectionDescription} |
There was a problem hiding this comment.
This still works but the canonical pattern you see on PF docs is to use StackItem inside Stack


Description
Refactor Section to use PatternFly 6’s Form and FormSection components, including the native title prop and section styling. Removed custom CSS that duplicated PatternFly’s form section title layout while preserving existing section content.
Jira issue #
FCN-667
Backport of #
Type of Change
Testing
Manual Testing
Test Steps:
Test Environment:
Automated Testing
E2E Run:
Unit Tests:
Integration Tests:
Screenshots/Recordings
Before
After
Checklist
Code Quality
Documentation
Accessibility
Dependencies
Breaking Changes
Does this PR introduce breaking changes?
Additional Notes
Reviewer Guidelines
Focus Areas
Questions for Reviewers