Skip to content

feat(Page): added styles for glass#12293

Merged
mcoker merged 8 commits intopatternfly:mainfrom
thatblindgeye:iss12270_pageGlass
Apr 6, 2026
Merged

feat(Page): added styles for glass#12293
mcoker merged 8 commits intopatternfly:mainfrom
thatblindgeye:iss12270_pageGlass

Conversation

@thatblindgeye
Copy link
Copy Markdown
Contributor

@thatblindgeye thatblindgeye commented Mar 25, 2026

What: Closes #12270

Waiting on core bump to go in to pull in correct styles object properties

Additional issues:

Summary by CodeRabbit

  • New Features

    • Added isPlain prop to PageSection and PageGroup to remove default background
    • Added isNoPlainOnGlass (beta) prop for specialized styling control
    • Added a new example showcasing plain sections and groups
  • Refactor

    • Adjusted masthead and sidebar markup wrappers for improved structure and styling consistency
  • Tests

    • Added/updated tests for docked masthead, sidebar wrapper, and plain/no-plain modifiers

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 25, 2026

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: 2fc13d3c-e2ad-42ea-b6a7-e93b652c32e9

📥 Commits

Reviewing files that changed from the base of the PR and between 631e4e4 and 511d8e0.

📒 Files selected for processing (2)
  • packages/react-core/src/components/Page/PageGroup.tsx
  • packages/react-core/src/components/Page/PageSection.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/react-core/src/components/Page/PageGroup.tsx

Walkthrough

Adds inner wrapper divs for docked masthead (pageDockMain) and sidebar content (pageSidebarMain), and introduces isPlain and isNoPlainOnGlass boolean props to PageSection and PageGroup with corresponding CSS modifier classes; tests, docs, and an example were added or updated.

Changes

Cohort / File(s) Summary
Page layout wrappers
packages/react-core/src/components/Page/Page.tsx, packages/react-core/src/components/Page/PageSidebar.tsx
When variant === 'docked', masthead is nested inside a new pageDockMain wrapper; PageSidebar now wraps children in a pageSidebarMain div. No public API signature changes.
Plain styling modifiers
packages/react-core/src/components/Page/PageGroup.tsx, packages/react-core/src/components/Page/PageSection.tsx
Added optional props isPlain?: boolean and isNoPlainOnGlass?: boolean (defaults false) and conditionally apply styles.modifiers.plain and styles.modifiers.noPlainOnGlass. isNoPlainOnGlass noted as beta.
Tests
packages/react-core/src/components/Page/__tests__/Page.test.tsx, .../PageGroup.test.tsx, .../PageSection.test.tsx, .../PageSidebar.test.tsx
Added/updated tests verifying pageDockMain and pageSidebarMain wrappers and new modifier-class behavior; PageGroup tests reorganized and new assertions for isPlain/isNoPlainOnGlass.
Docs & examples
packages/react-core/src/components/Page/examples/Page.md, packages/react-core/src/components/Page/examples/PagePlainSections.tsx
Docs updated to document plain sections/groups; new PagePlainSections example added demonstrating isPlain usage and a sidebar toggle.
Dev dependency bumps
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.62 to 6.5.0-prerelease.65 across several packages.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

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

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat(Page): added styles for glass' is vague and does not clearly convey the main changes—it doesn't specify the new wrappers, modifiers, or structural layout changes introduced in the PR. Consider a more descriptive title such as 'feat(Page): add glass-style wrappers and plain modifiers for PageSection/PageGroup' to better reflect the core changes.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #12270: introduces PageDockMain and PageSidebarMain wrappers, adds isPlain and isNoPlainOnGlass modifiers to PageSection and PageGroup, and includes comprehensive test coverage for these changes.
Out of Scope Changes check ✅ Passed All changes are scoped to the Page component feature set. Package.json version updates for @patternfly/patternfly are necessary aligned changes; documentation and examples are appropriate supporting additions.
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
Copy Markdown
Collaborator

patternfly-build commented Mar 25, 2026

@thatblindgeye thatblindgeye force-pushed the iss12270_pageGlass branch 2 times, most recently from 3458253 to 5a7926c Compare April 1, 2026 14:18
@thatblindgeye
Copy link
Copy Markdown
Contributor Author

My assumption is the integration tests are failing due to this Core bug? patternfly/patternfly#8243

@thatblindgeye thatblindgeye marked this pull request as ready for review April 1, 2026 15:38
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: 4

🧹 Nitpick comments (1)
packages/react-core/src/components/Page/examples/PagePlainSections.tsx (1)

48-50: Add rel="noopener noreferrer" for external link security.

When using target="_blank" with external links, it's a security best practice to include rel="noopener noreferrer" to prevent the opened page from accessing window.opener.

🔒 Proposed fix
-          <MastheadLogo href="https://patternfly.org" target="_blank">
+          <MastheadLogo href="https://patternfly.org" target="_blank" rel="noopener noreferrer">
             Logo
           </MastheadLogo>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-core/src/components/Page/examples/PagePlainSections.tsx`
around lines 48 - 50, The external MastheadLogo anchor uses target="_blank"
without the security attributes; update the JSX for the MastheadLogo component
instance (the MastheadLogo element in PagePlainSections) to include
rel="noopener noreferrer" alongside target="_blank" so the opened page cannot
access window.opener and to mitigate reverse tabnabbing risks.
🤖 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/Page/__tests__/Page.test.tsx`:
- Around line 410-417: Rename the first duplicate/misleading test title so it
reflects that the test asserts the absence of the pageDockMain wrapper when the
Page is not docked; update the test(...) string that currently reads "Renders
with ${styles.pageDockMain} wrapper when variant is docked" to something like
"Does not render ${styles.pageDockMain} wrapper when variant is not docked" to
avoid duplication with the positive docked case and make it clear this test
checks non-docked behavior (refer to the test block that renders <Page
masthead={<>Masthead</>} data-testid="page"> and uses
screen.getByText('Masthead').closest(`.${styles.pageDockMain}`)).

In `@packages/react-core/src/components/Page/__tests__/PageGroup.test.tsx`:
- Around line 99-102: The test title is incorrect: update the test description
for the test that renders <PageGroup isNoPlainOnGlass> so it references the
isNoPlainOnGlass prop (not isPlain). Locate the test with the template literal
test(`Renders with ${styles.modifiers.noPlainOnGlass} class when isPlain is
true`, ...) and change the string to something like "Renders with
${styles.modifiers.noPlainOnGlass} class when isNoPlainOnGlass is true" so the
title matches the prop under test (PageGroup, isNoPlainOnGlass,
styles.modifiers.noPlainOnGlass).

In `@packages/react-core/src/components/Page/__tests__/PageSection.test.tsx`:
- Around line 193-200: Update the test title to accurately reflect the prop
being tested: change the description string in the test for PageSection from
referencing isPlain to reference isNoPlainOnGlass; locate the test that renders
<PageSection hasBodyWrapper={false} isNoPlainOnGlass> and update its title to
something like "Renders with noPlainOnGlass class when isNoPlainOnGlass is true"
so it matches the assertion that expects styles.modifiers.noPlainOnGlass.

In `@packages/react-core/src/components/Page/Page.tsx`:
- Around line 351-354: The PR imports a missing CSS module causing
styles.pageDockMain (used in Page.tsx within the variant === 'docked' branch) to
be undefined; either add the Page CSS artifact to `@patternfly/react-styles`
exporting the required keys (pageDockMain and pageSidebarMain) or remove/guard
usages of styles.pageDockMain and styles.pageSidebarMain in the Page component
(and other Page-related files) until the CSS module exists; update the import
that references packages/react-styles/css/components/Page/page to point to the
correct file or ensure the package publishes the page CSS with the exact keys
expected by the Page component.

---

Nitpick comments:
In `@packages/react-core/src/components/Page/examples/PagePlainSections.tsx`:
- Around line 48-50: The external MastheadLogo anchor uses target="_blank"
without the security attributes; update the JSX for the MastheadLogo component
instance (the MastheadLogo element in PagePlainSections) to include
rel="noopener noreferrer" alongside target="_blank" so the opened page cannot
access window.opener and to mitigate reverse tabnabbing risks.
🪄 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: bac938c5-d927-4bdb-af19-bbf905e56989

📥 Commits

Reviewing files that changed from the base of the PR and between 93e7816 and ce66449.

⛔ Files ignored due to path filters (3)
  • packages/react-core/src/components/Page/__tests__/Generated/__snapshots__/PageSidebar.test.tsx.snap is excluded by !**/*.snap, !**/generated/**
  • packages/react-core/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap is excluded by !**/*.snap
  • packages/react-core/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (10)
  • packages/react-core/src/components/Page/Page.tsx
  • packages/react-core/src/components/Page/PageGroup.tsx
  • packages/react-core/src/components/Page/PageSection.tsx
  • packages/react-core/src/components/Page/PageSidebar.tsx
  • packages/react-core/src/components/Page/__tests__/Page.test.tsx
  • packages/react-core/src/components/Page/__tests__/PageGroup.test.tsx
  • packages/react-core/src/components/Page/__tests__/PageSection.test.tsx
  • packages/react-core/src/components/Page/__tests__/PageSidebar.test.tsx
  • packages/react-core/src/components/Page/examples/Page.md
  • packages/react-core/src/components/Page/examples/PagePlainSections.tsx

Comment on lines +410 to +417
test(`Renders with ${styles.pageDockMain} wrapper when variant is docked`, () => {
render(<Page masthead={<>Masthead</>} data-testid="page"></Page>);

const pageDockMain = screen.getByText('Masthead').closest(`.${styles.pageDockMain}`);
expect(pageDockMain).not.toBeInTheDocument();
});

test(`Renders with ${styles.pageDockMain} wrapper when variant is docked`, () => {
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 | 🟡 Minor

Rename the first dock-wrapper test; current title is misleading and duplicated.

The first new test verifies the absence of pageDockMain when variant is not docked, but its title duplicates the docked-positive case.

Proposed test-title fix
-test(`Renders with ${styles.pageDockMain} wrapper when variant is docked`, () => {
+test(`Does not render ${styles.pageDockMain} wrapper when variant is not docked`, () => {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-core/src/components/Page/__tests__/Page.test.tsx` around lines
410 - 417, Rename the first duplicate/misleading test title so it reflects that
the test asserts the absence of the pageDockMain wrapper when the Page is not
docked; update the test(...) string that currently reads "Renders with
${styles.pageDockMain} wrapper when variant is docked" to something like "Does
not render ${styles.pageDockMain} wrapper when variant is not docked" to avoid
duplication with the positive docked case and make it clear this test checks
non-docked behavior (refer to the test block that renders <Page
masthead={<>Masthead</>} data-testid="page"> and uses
screen.getByText('Masthead').closest(`.${styles.pageDockMain}`)).

@thatblindgeye thatblindgeye requested a review from mcoker April 6, 2026 17:10
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 `@packages/react-core/src/components/Page/PageSection.tsx`:
- Around line 135-136: Add a unit test that mounts PageSection (and mirror for
PageGroup) with both props isPlain={true} and isNoPlainOnGlass={true} and assert
that the plain modifier (styles.modifiers.plain) is applied and the
noPlainOnGlass modifier (styles.modifiers.noPlainOnGlass) is not applied — this
verifies the documented precedence "isPlain takes precedence" when both flags
are set; locate tests referencing PageSection and PageGroup and augment them or
add a new test case that checks class presence/absence for those two modifiers.
🪄 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: 6cacd466-efa9-4e39-bb7b-27c9c806c35e

📥 Commits

Reviewing files that changed from the base of the PR and between 7d90f05 and 631e4e4.

⛔ Files ignored due to path filters (4)
  • packages/react-core/src/components/Page/__tests__/Generated/__snapshots__/PageSidebar.test.tsx.snap is excluded by !**/*.snap, !**/generated/**
  • packages/react-core/src/components/Page/__tests__/__snapshots__/Page.test.tsx.snap is excluded by !**/*.snap
  • packages/react-core/src/components/Page/__tests__/__snapshots__/PageGroup.test.tsx.snap is excluded by !**/*.snap
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (15)
  • packages/react-core/package.json
  • packages/react-core/src/components/Page/Page.tsx
  • packages/react-core/src/components/Page/PageGroup.tsx
  • packages/react-core/src/components/Page/PageSection.tsx
  • packages/react-core/src/components/Page/PageSidebar.tsx
  • packages/react-core/src/components/Page/__tests__/Page.test.tsx
  • packages/react-core/src/components/Page/__tests__/PageGroup.test.tsx
  • packages/react-core/src/components/Page/__tests__/PageSection.test.tsx
  • packages/react-core/src/components/Page/__tests__/PageSidebar.test.tsx
  • packages/react-core/src/components/Page/examples/Page.md
  • packages/react-core/src/components/Page/examples/PagePlainSections.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 (9)
  • packages/react-styles/package.json
  • packages/react-tokens/package.json
  • packages/react-icons/package.json
  • packages/react-docs/package.json
  • packages/react-core/src/components/Page/tests/PageSection.test.tsx
  • packages/react-core/src/components/Page/tests/PageGroup.test.tsx
  • packages/react-core/package.json
  • packages/react-core/src/components/Page/tests/PageSidebar.test.tsx
  • packages/react-core/src/components/Page/examples/Page.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • packages/react-core/src/components/Page/tests/Page.test.tsx
  • packages/react-core/src/components/Page/PageSidebar.tsx
  • packages/react-core/src/components/Page/PageGroup.tsx
  • packages/react-core/src/components/Page/examples/PagePlainSections.tsx
  • packages/react-core/src/components/Page/Page.tsx

Comment on lines +135 to +136
isPlain && styles.modifiers.plain,
isNoPlainOnGlass && styles.modifiers.noPlainOnGlass,
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 | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if PageGroup applies the same modifiers consistently and verify test coverage for the precedence behavior.

# Check PageGroup for consistent implementation
rg -n -A5 'isPlain && styles\.modifiers\.plain' packages/react-core/src/components/Page/

# Check test coverage for combined isPlain + isNoPlainOnGlass scenario
rg -n -B2 -A5 'isPlain.*isNoPlainOnGlass|isNoPlainOnGlass.*isPlain' packages/react-core/src/components/Page/__tests__/

Repository: patternfly/patternfly-react

Length of output: 1213


🏁 Script executed:

# Locate the JSDoc for isPlain and isNoPlainOnGlass in PageSection
rg -n -B10 'isPlain' packages/react-core/src/components/Page/PageSection.tsx | head -80

Repository: patternfly/patternfly-react

Length of output: 1895


🏁 Script executed:

# Look for JSDoc or prop definitions that mention the precedence behavior
rg -n 'When both.*isPlain|precedence' packages/react-core/src/components/Page/

Repository: patternfly/patternfly-react

Length of output: 534


🏁 Script executed:

# Check for any test files that verify the combined isPlain + isNoPlainOnGlass behavior
find packages/react-core/src/components/Page/__tests__ -name '*.test.tsx' -o -name '*.test.ts'

Repository: patternfly/patternfly-react

Length of output: 719


🏁 Script executed:

# Check PageSection.test.tsx for tests with both isPlain and isNoPlainOnGlass
cat packages/react-core/src/components/Page/__tests__/PageSection.test.tsx

Repository: patternfly/patternfly-react

Length of output: 7002


🏁 Script executed:

# Check PageGroup.test.tsx for tests with both isPlain and isNoPlainOnGlass
cat packages/react-core/src/components/Page/__tests__/PageGroup.test.tsx

Repository: patternfly/patternfly-react

Length of output: 3715


Add test coverage for combined isPlain and isNoPlainOnGlass scenario.

The JSDoc documents the intended behavior ("When both this and isPlain are true, isPlain takes precedence"), and the implementation applies both modifier classes consistently in PageSection and PageGroup. However, test coverage is missing for when both props are true simultaneously; currently only individual modifiers are tested.

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

In `@packages/react-core/src/components/Page/PageSection.tsx` around lines 135 -
136, Add a unit test that mounts PageSection (and mirror for PageGroup) with
both props isPlain={true} and isNoPlainOnGlass={true} and assert that the plain
modifier (styles.modifiers.plain) is applied and the noPlainOnGlass modifier
(styles.modifiers.noPlainOnGlass) is not applied — this verifies the documented
precedence "isPlain takes precedence" when both flags are set; locate tests
referencing PageSection and PageGroup and augment them or add a new test case
that checks class presence/absence for those two modifiers.

'aria-label'?: string;
/** Adds plain styling to the page group. */
isPlain?: boolean;
/** @beta Prevents the page group from automatically applying plain styling when glass theme is enabled. When both this and isPlain are true, isPlain takes precedence. */
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.

The note about both flags should be removed from the description.

component?: keyof React.JSX.IntrinsicElements;
/** Adds plain styling to the page section. */
isPlain?: boolean;
/** @beta Prevents the page section from automatically applying plain styling when glass theme is enabled. When both this and isPlain are true, isPlain takes precedence. */
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.

Same here.

@thatblindgeye thatblindgeye requested a review from kmcfaul April 6, 2026 17:53
Copy link
Copy Markdown
Contributor

@kmcfaul kmcfaul left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Copy Markdown
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.

📄

@mcoker mcoker merged commit 1f7485b into patternfly:main Apr 6, 2026
14 checks passed
@patternfly-build
Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-charts@8.5.0-prerelease.19
  • @patternfly/react-code-editor@6.5.0-prerelease.53
  • @patternfly/react-core@6.5.0-prerelease.50
  • @patternfly/react-docs@7.5.0-prerelease.59
  • @patternfly/react-drag-drop@6.5.0-prerelease.51
  • @patternfly/react-icons@6.5.0-prerelease.21
  • demo-app-ts@6.5.0-prerelease.79
  • @patternfly/react-styles@6.5.0-prerelease.16
  • @patternfly/react-table@6.5.0-prerelease.51
  • @patternfly/react-templates@6.5.0-prerelease.50
  • @patternfly/react-tokens@6.5.0-prerelease.15

Thanks for your contribution! 🎉

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.

Page - follow up for glass styles (react followup)

4 participants