Skip to content

feat(Hero): glass styling update#12412

Open
kmcfaul wants to merge 3 commits intopatternfly:mainfrom
kmcfaul:hero-updates
Open

feat(Hero): glass styling update#12412
kmcfaul wants to merge 3 commits intopatternfly:mainfrom
kmcfaul:hero-updates

Conversation

@kmcfaul
Copy link
Copy Markdown
Contributor

@kmcfaul kmcfaul commented May 7, 2026

What: Closes #12413

Additional issues:

Summary by CodeRabbit

  • New Features

    • Hero component gains an optional "glass" visual style (opt-in prop) with default off.
  • Tests

    • Updated tests to verify default styling and conditional glass styling behavior.
  • Chores

    • Aligned design system/dev tooling across packages to keep styling and tokens consistent.
  • Docs / Demos

    • Demo updated to showcase the Hero glass usage in multi-line child form.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a25bb9bd-3f37-42d6-877b-8eb9f8408849

📥 Commits

Reviewing files that changed from the base of the PR and between 7848d35 and c45bed8.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • packages/react-core/package.json
  • packages/react-core/src/components/Hero/Hero.tsx
  • packages/react-core/src/components/Hero/__tests__/Hero.test.tsx
  • packages/react-core/src/demos/Compass/examples/CompassDemo.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 (3)
  • packages/react-styles/package.json
  • packages/react-tokens/package.json
  • packages/react-docs/package.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/react-icons/package.json
  • packages/react-core/package.json
  • packages/react-core/src/components/Hero/Hero.tsx
  • packages/react-core/src/components/Hero/tests/Hero.test.tsx

Walkthrough

This PR replaces Hero's hasNoGlass prop with isGlass, updates @patternfly/patternfly to 6.5.0-prerelease.82 across packages, and adds tests and a demo update to validate the glass modifier behavior.

Changes

Hero Component Glass Prop Migration

Layer / File(s) Summary
Dependency 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
PatternFly dependency bumped from 6.5.0-prerelease.79 to 6.5.0-prerelease.82.
Hero Props API
packages/react-core/src/components/Hero/Hero.tsx
HeroProps replaces hasNoGlass?: boolean with isGlass?: boolean (default false).
Hero Implementation
packages/react-core/src/components/Hero/Hero.tsx
Component default destructuring changed from hasNoGlass = false to isGlass = false; wrapper className now applies styles.modifiers.glass when isGlass is true instead of toggling styles.modifiers.noGlass.
Tests & Demo
packages/react-core/src/components/Hero/__tests__/Hero.test.tsx, packages/react-core/src/demos/Compass/examples/CompassDemo.tsx
Tests added/updated to assert default styles.hero and conditional styles.modifiers.glass presence; demo Hero usage updated to pass isGlass prop and render child text on its own line.

🎯 3 (Moderate) | ⏱️ ~20 minutes


Possibly related PRs


Suggested reviewers

  • mcoker
  • thatblindgeye
  • 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(Hero): glass styling update' directly and clearly summarizes the main change—updating Hero component's glass styling.
Linked Issues check ✅ Passed The PR implements glass styling updates to the Hero component (isGlass prop replacing hasNoGlass, updated tests, demo usage, and upstream PatternFly dependency bump to 6.5.0-prerelease.82), meeting issue #12413's objective to align React implementation with upstream design changes.
Out of Scope Changes check ✅ Passed All changes are directly scoped to Hero component glass styling updates: Hero props/component refactoring, tests, demo updates, and dependency version bumps across affected packages. No unrelated changes detected.
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.

@kmcfaul kmcfaul linked an issue May 7, 2026 that may be closed by this pull request
@patternfly-build
Copy link
Copy Markdown
Collaborator

patternfly-build commented May 7, 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

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

37-38: ⚡ Quick win

Consider a temporary compatibility bridge for the removed hasNoGlass prop.

Dropping hasNoGlass outright introduces a breaking API change for existing consumers. A short deprecation window (accept both props, prefer isGlass) would reduce upgrade friction.

Proposed compatibility diff
 export interface HeroProps extends Omit<React.HTMLProps<HTMLDivElement>, 'content'> {
@@
   /** Flag indicating the hero has glass styling when glass theme is applied. */
   isGlass?: boolean;
+  /** `@deprecated` Use `isGlass` instead. */
+  hasNoGlass?: boolean;
@@
 export const Hero: React.FunctionComponent<HeroProps> = ({
@@
-  isGlass = false,
+  isGlass,
+  hasNoGlass,
@@
 }) => {
+  const useGlass = isGlass ?? (hasNoGlass !== undefined ? !hasNoGlass : false);
@@
-      className={css(styles.hero, isGlass && styles.modifiers.glass, className)}
+      className={css(styles.hero, useGlass && styles.modifiers.glass, className)}

Also applies to: 52-53, 93-93

🤖 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/Hero/Hero.tsx` around lines 37 - 38, Hero
component removed the legacy hasNoGlass prop causing a breaking change; add a
temporary compatibility bridge by accepting an optional hasNoGlass?: boolean in
the Hero props and mapping it to the new isGlass boolean when isGlass is
undefined (i.e., derive isGlass = props.isGlass ?? !props.hasNoGlass). Emit a
single deprecation warning (console.warn) when hasNoGlass is provided, prefer
isGlass in all internal checks (e.g., inside the Hero render logic and any
helper functions referenced in this file), and keep the public type including
hasNoGlass as deprecated so consumers have a short migration window.
🤖 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/Hero/__tests__/Hero.test.tsx`:
- Around line 25-41: The tests for the Hero component use toHaveClass with {
exact: true } against the parent element which also contains the base hero
class; update the three test cases that reference styles.modifiers.glass (the
tests whose titles include "Renders with ... class when isGlass is true",
"Renders without ... class when isGlass is false", and "Renders without ...
class by default") to call toHaveClass(styles.modifiers.glass) and
.not.toHaveClass(styles.modifiers.glass) without the { exact: true } option so
the assertions check for the presence/absence of the modifier class rather than
an exact class list.

---

Nitpick comments:
In `@packages/react-core/src/components/Hero/Hero.tsx`:
- Around line 37-38: Hero component removed the legacy hasNoGlass prop causing a
breaking change; add a temporary compatibility bridge by accepting an optional
hasNoGlass?: boolean in the Hero props and mapping it to the new isGlass boolean
when isGlass is undefined (i.e., derive isGlass = props.isGlass ??
!props.hasNoGlass). Emit a single deprecation warning (console.warn) when
hasNoGlass is provided, prefer isGlass in all internal checks (e.g., inside the
Hero render logic and any helper functions referenced in this file), and keep
the public type including hasNoGlass as deprecated so consumers have a short
migration window.
🪄 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: 28925f87-e424-41d6-baca-e1b666eb61c9

📥 Commits

Reviewing files that changed from the base of the PR and between 3502b37 and de101bd.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (8)
  • packages/react-core/package.json
  • packages/react-core/src/components/Hero/Hero.tsx
  • packages/react-core/src/components/Hero/__tests__/Hero.test.tsx
  • packages/react-core/src/demos/Compass/examples/CompassDemo.tsx
  • packages/react-docs/package.json
  • packages/react-icons/package.json
  • packages/react-styles/package.json
  • packages/react-tokens/package.json

Comment thread packages/react-core/src/components/Hero/__tests__/Hero.test.tsx
Copy link
Copy Markdown
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Just a question below, but lgtm

Comment on lines +37 to +38
/** Flag indicating the hero has glass styling when glass theme is applied. */
isGlass?: boolean;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want this to be beta?

Copy link
Copy Markdown
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

D-d-double approval, now with 125% more correct rhds-icon version

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.

Hero - glass style updates

3 participants