Skip to content

feat(Wizard): added plain styling#12289

Open
thatblindgeye wants to merge 5 commits intopatternfly:mainfrom
thatblindgeye:iss12277_wizardPlain
Open

feat(Wizard): added plain styling#12289
thatblindgeye wants to merge 5 commits intopatternfly:mainfrom
thatblindgeye:iss12277_wizardPlain

Conversation

@thatblindgeye
Copy link
Contributor

@thatblindgeye thatblindgeye commented Mar 24, 2026

What: Closes #12277

Additional issues:

Summary by CodeRabbit

  • New Features

    • Wizard gains two optional styling flags to enable a plain appearance and to control plain behavior on glass surfaces, allowing more visual customization.
  • Tests

    • Added tests confirming the new styling flags apply the expected visual modifier classes to the Wizard root element.
  • Documentation

    • Added a "Plain" Wizard example and updated example docs to demonstrate the new styling options and usage.

@thatblindgeye thatblindgeye requested review from kmcfaul and mcoker March 24, 2026 17:37
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

Walkthrough

Adds two optional props, isPlain and isNoPlainOnGlass, to the Wizard component to conditionally apply .pf-m-plain and .pf-m-no-plain modifier classes; includes tests, documentation entry, and a new example demonstrating the plain wizard styling.

Changes

Cohort / File(s) Summary
Core Component Implementation
packages/react-core/src/components/Wizard/Wizard.tsx
Added optional isPlain?: boolean and isNoPlainOnGlass?: boolean to WizardProps. Updated prop destructuring and root <div> className composition to include styles.modifiers.plain when isPlain is true and styles.modifiers.noPlain when isNoPlainOnGlass is true, while preserving consumer className.
Component Tests
packages/react-core/src/components/Wizard/__tests__/Wizard.test.tsx
Added assertions verifying the root element receives styles.modifiers.plain when isPlain is passed and styles.modifiers.noPlain when isNoPlainOnGlass is passed.
Documentation & Examples
packages/react-core/src/components/Wizard/examples/Wizard.md, packages/react-core/src/components/Wizard/examples/WizardPlain.tsx
Added a "Plain" example entry and a new WizardPlain example component demonstrating a plain-styled Wizard with three steps and a footer configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • mcoker
  • dlabaj
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR is missing the isNoPlain prop implementation required by issue #12277, which should apply the .pf-m-no-plain modifier to opt out of auto-plain styling with glass theme. Add the isNoPlain prop to WizardProps and implement logic to apply styles.modifiers.noPlain when isNoPlainOnGlass is false or when explicitly set, ensuring glass theme opt-out functionality is complete.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(Wizard): added plain styling' clearly and concisely summarizes the main change—adding plain styling support to the Wizard component.
Out of Scope Changes check ✅ Passed All changes directly support the objectives outlined in issue #12277: adding plain styling props, example documentation, component tests, and TypeScript types for the Wizard component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ 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 and usage tips.

@patternfly-build
Copy link
Collaborator

patternfly-build commented Mar 24, 2026

*/
shouldFocusContent?: boolean;
/** Adds plain styling to the wizard. */
isPlain?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious, does this prop do nothing? Or are style changes applied with pf-m-plain. I ask because it is hard coded below so I am assuming it has no styles associated with it.
If the prop does not do anything, do we need to add it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This prop will dictate whether the pf-m-plain class is applied

Copy link

@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 `@packages/react-core/src/components/Wizard/Wizard.tsx`:
- Around line 62-65: The public prop should be renamed to isNoPlain while
keeping isNoPlainOnGlass as a deprecated alias: update the Wizard component
props (the isPlain/isNoPlainOnGlass declarations) to accept isNoPlain?: boolean
and treat isNoPlainOnGlass as optional legacy input (e.g., const
effectiveIsNoPlain = isNoPlain ?? isNoPlainOnGlass) so existing behavior is
preserved; update all internal usages in Wizard (and the other occurrences
referenced around lines ~84-85 and ~190-195) to read effectiveIsNoPlain, and add
a short deprecation note/comment for isNoPlainOnGlass so consumers know to
migrate.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 05040312-0989-4c99-b9e7-989d6905b328

📥 Commits

Reviewing files that changed from the base of the PR and between 1f03ff8 and c9b22f4.

📒 Files selected for processing (1)
  • packages/react-core/src/components/Wizard/Wizard.tsx

Comment on lines +62 to +65
/** Adds plain styling to the wizard. */
isPlain?: boolean;
/** @beta Prevents the wizard from automatically applying plain styling when glass theme is enabled. */
isNoPlainOnGlass?: boolean;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Expose isNoPlain as the public prop (keep isNoPlainOnGlass as alias/deprecated).

The behavior is wired correctly, but the public API currently diverges from the requested isNoPlain prop. This can create avoidable churn for consumers and docs.

Proposed compatibility update
 export interface WizardProps extends React.HTMLProps<HTMLDivElement> {
   /** Adds plain styling to the wizard. */
   isPlain?: boolean;
+  /** Prevents the wizard from automatically applying plain styling when glass theme is enabled. */
+  isNoPlain?: boolean;
   /** `@beta` Prevents the wizard from automatically applying plain styling when glass theme is enabled. */
   isNoPlainOnGlass?: boolean;
 }

 export const Wizard = ({
   ...
   isPlain = false,
+  isNoPlain = false,
   isNoPlainOnGlass = false,
   ...wrapperProps
 }: WizardProps) => {
+  const noPlain = isNoPlain || isNoPlainOnGlass;
   ...
       <div
         className={css(
           styles.wizard,
           isPlain && styles.modifiers.plain,
-          isNoPlainOnGlass && styles.modifiers.noPlain,
+          noPlain && styles.modifiers.noPlain,
           className
         )}

Also applies to: 84-85, 190-195

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-core/src/components/Wizard/Wizard.tsx` around lines 62 - 65,
The public prop should be renamed to isNoPlain while keeping isNoPlainOnGlass as
a deprecated alias: update the Wizard component props (the
isPlain/isNoPlainOnGlass declarations) to accept isNoPlain?: boolean and treat
isNoPlainOnGlass as optional legacy input (e.g., const effectiveIsNoPlain =
isNoPlain ?? isNoPlainOnGlass) so existing behavior is preserved; update all
internal usages in Wizard (and the other occurrences referenced around lines
~84-85 and ~190-195) to read effectiveIsNoPlain, and add a short deprecation
note/comment for isNoPlainOnGlass so consumers know to migrate.

*/
shouldFocusContent?: boolean;
/** Adds plain styling to the wizard. */
isPlain?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious - why is isNoPlainOnGlass beta but isPlain isn't? I'm not suggesting updating it, I just hadn't thought of these being beta.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We probably could make both beta; I think at least having the isNo... prop as beta gives us an easier means to remove the prop if needed down the line (without having to deprecate then wait for a breaking release)

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

LGTM. Only comment is that the example doesn't really show any difference. IMO it's fine but we could also use a wizard with a header so it changes a little.

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.

Add plain styling support to Wizard component

4 participants