Skip to content

feat(Wizard): added plain styling#12289

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

feat(Wizard): added plain styling#12289
thatblindgeye wants to merge 6 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 adds two optional styling flags for a plain appearance and controlling plain behavior on glass surfaces; enabling both emits a runtime warning and the plain flag takes precedence.
  • Tests

    • Added tests verifying the new styling flags apply correct modifier classes and the warning behavior when both flags are set.
  • Documentation

    • Added a "Plain" Wizard example demonstrating the new styling options.
  • Chores

    • Updated dev dependency versions for PatternFly across packages.

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

coderabbitai bot commented Mar 24, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

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, a new example demonstrating the plain wizard styling, and a console.warn when both flags are true (noting isPlain takes precedence).

Changes

Cohort / File(s) Summary
Core Component
packages/react-core/src/components/Wizard/Wizard.tsx
Added isPlain?: boolean and isNoPlainOnGlass?: boolean to WizardProps. Destructured props with defaults isPlain = false, isNoPlainOnGlass = false. Root <div> className now conditionally includes styles.modifiers.plain when isPlain is true and styles.modifiers.noPlainOnGlass (or similar) when isNoPlainOnGlass is true. Adds a runtime console.warn when both flags are true and documents precedence of isPlain.
Tests
packages/react-core/src/components/Wizard/__tests__/Wizard.test.tsx
Added tests importing Wizard CSS module and asserting modifier classes are applied when isPlain or isNoPlainOnGlass are set; added assertions for console.warn behavior (no warn for single flag, specific warn when both true).
Docs & Examples
packages/react-core/src/components/Wizard/examples/Wizard.md, packages/react-core/src/components/Wizard/examples/WizardPlain.tsx
Added a new "Plain" example entry and WizardPlain example component demonstrating a plain-styled Wizard (three steps, footer on review step).
DevDependency updates
packages/react-core/package.json, packages/react-docs/package.json, packages/react-icons/package.json, packages/react-styles/package.json, packages/react-tokens/package.json
Bumped @patternfly/patternfly devDependency from 6.5.0-prerelease.55 to 6.5.0-prerelease.58 across multiple package.json files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • kmcfaul
  • mcoker
  • nicolethoen
🚥 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 'feat(Wizard): added plain styling' clearly and concisely describes the main change: adding plain styling support to the Wizard component.
Linked Issues check ✅ Passed The PR implements all required coding changes: isPlain and isNoPlainOnGlass props added to Wizard, test cases added, Plain example created, and TypeScript types updated per #12277.
Out of Scope Changes check ✅ Passed The PR includes only PatternFly dependency version updates across multiple package.json files beyond the core Wizard component changes, which are minimal and support the plain styling feature.
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.

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.

🧹 Nitpick comments (1)
packages/react-core/src/components/Wizard/Wizard.tsx (1)

88-93: Consider warning only once instead of on every render.

The current implementation logs the warning on every render when both props are true, which could spam the console if the component re-renders frequently. Consider using a ref to ensure the warning fires only once.

♻️ Proposed fix to warn only once
+import { useEffect, useMemo, useRef, useState } from 'react';
+
 export const Wizard = ({
   ...
   isPlain = false,
   isNoPlainOnGlass = false,
   ...wrapperProps
 }: WizardProps) => {
-  if (isPlain && isNoPlainOnGlass) {
-    // eslint-disable-next-line no-console
-    console.warn(
-      `Wizard: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme.`
-    );
-  }
+  const hasWarnedRef = useRef(false);
+  if (isPlain && isNoPlainOnGlass && !hasWarnedRef.current) {
+    // eslint-disable-next-line no-console
+    console.warn(
+      `Wizard: When both isPlain and isNoPlainOnGlass are true, isPlain will take precedence and isNoPlainOnGlass will have no effect. It's recommended to pass only one prop according to the current theme.`
+    );
+    hasWarnedRef.current = true;
+  }
🤖 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 88 - 93,
The console warning in the Wizard component currently runs on every render when
isPlain and isNoPlainOnGlass are both true; change this to only warn once by
adding a local ref (e.g., warnedRef = useRef(false)) and moving the warning into
a useEffect that checks if isPlain && isNoPlainOnGlass && !warnedRef.current,
calls console.warn, then sets warnedRef.current = true; update the code that
currently logs inside the render path (the block referencing isPlain and
isNoPlainOnGlass) to use this useEffect pattern so the message fires only a
single time per mount.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/react-core/src/components/Wizard/Wizard.tsx`:
- Around line 88-93: The console warning in the Wizard component currently runs
on every render when isPlain and isNoPlainOnGlass are both true; change this to
only warn once by adding a local ref (e.g., warnedRef = useRef(false)) and
moving the warning into a useEffect that checks if isPlain && isNoPlainOnGlass
&& !warnedRef.current, calls console.warn, then sets warnedRef.current = true;
update the code that currently logs inside the render path (the block
referencing isPlain and isNoPlainOnGlass) to use this useEffect pattern so the
message fires only a single time per mount.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b5e22fd6-92ad-4d09-8986-f2417f228536

📥 Commits

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

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • packages/react-core/package.json
  • packages/react-core/src/components/Wizard/Wizard.tsx
  • packages/react-core/src/components/Wizard/__tests__/Wizard.test.tsx
  • packages/react-core/src/components/Wizard/examples/Wizard.md
  • packages/react-core/src/components/Wizard/examples/WizardPlain.tsx
  • packages/react-docs/package.json
  • packages/react-icons/package.json
  • packages/react-styles/package.json
  • packages/react-tokens/package.json
✅ Files skipped from review due to trivial changes (6)
  • packages/react-docs/package.json
  • packages/react-core/src/components/Wizard/examples/Wizard.md
  • packages/react-styles/package.json
  • packages/react-core/package.json
  • packages/react-tokens/package.json
  • packages/react-icons/package.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/react-core/src/components/Wizard/tests/Wizard.test.tsx
  • packages/react-core/src/components/Wizard/examples/WizardPlain.tsx

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

5 participants