Skip to content

feat(Panel, CompassPanel): Removed CompassPanel component. Updated Panel component for use in with compass#12372

Merged
thatblindgeye merged 2 commits intopatternfly:mainfrom
tlabaj:panel_compass
Apr 24, 2026
Merged

feat(Panel, CompassPanel): Removed CompassPanel component. Updated Panel component for use in with compass#12372
thatblindgeye merged 2 commits intopatternfly:mainfrom
tlabaj:panel_compass

Conversation

@tlabaj
Copy link
Copy Markdown
Contributor

@tlabaj tlabaj commented Apr 22, 2026

What: Closes #12271

Summary

Replaces the Compass-specific CompassPanel wrapper with the shared Panel API and extends Panel with several layout/style modifiers. Compass examples and the CompassMainHeader title/toolbar path now use PanelPanelMainPanelMainBody. Panel docs and tests are updated to match.

Compass

  • Removed CompassPanel and its unit tests / snapshots; dropped its export from Compass / package surface.
  • CompassMainHeader: Renders the title/toolbar layout with Panel, PanelMain, and PanelMainBody around CompassMainHeaderContent. The compassPanelProps object is typed as Omit<PanelProps, 'children'> (replaces CompassPanelProps).
  • Docs & examples: Compass.md and structure examples now describe Panel / PanelMain / PanelMainBody instead of CompassPanel.
  • JSDoc: CompassContent and CompassMainHeaderContent text updated to reference the Panel stack.
  • Tests: CompassMainHeader tests and snapshots expect the Panel root (e.g. pf-v6-c-panel) instead of the old compass panel class.
  • Demos: CompassBasic, CompassDockLayout, CompassDemo, and CompassDockDemo use the Panel stack. CompassDemo: Restores prior CompassPanel behavior by passing isPill on Panel where the old code used isPill, and using style={{ padding: 0 }} on PanelMainBody where the old code used hasNoPadding (no hasNoPadding on Panel in core today).

Panel

New optional props (JSDoc @beta) on Panel, applied via css() and existing PatternFly pf-m-* modifiers in @patternfly/react-styles:

Prop Modifier
hasNoBorder pf-m-no-border
isFullHeight pf-m-full-height
isGlass pf-m-glass
isAutoHeight pf-m-scrollable-auto-height
isPill pf-m-pill

(isScrollable / variant remain as before.)

Panel — docs & examples

  • PanelPill.tsx: Pill Panel with a single “Main content” line in the body.
  • PanelScrollableWithAutoHeight.tsx: Scrollable panel with auto height in a short parent container.
  • Panel.md: New sections for Pill and Scrollable with auto height (and ordering adjusted vs. “Scrollable” / “Scrollable with header and footer” as implemented).

Panel — tests

  • import '@testing-library/jest-dom' so toBeVisible / toHaveClass / etc. are typed and available.
  • Unit tests for each new boolean: class present when true, absent when false / undefined.
  • Snapshots for representative combinations (e.g. hasNoBorder, isFullHeight, isGlass, isAutoHeight with isScrollable, isPill).

Breaking changes

  • CompassPanel is removed; consumers should use Panel + PanelMain + PanelMainBody (and compassPanelProps now matches Panel only — old CompassPanel-only flags like isPill / hasNoBorder on that API are now expressed with Panel props or, for “no body padding,” via PanelMainBody / layout as needed).

Summary by CodeRabbit

  • New Features

    • Panel gains beta visual variants: isAutoHeight, hasNoBorder, isFullHeight, isGlass, isPill; new examples for pill and scrollable/auto-height.
  • Breaking Changes

    • Removed CompassPanel — Compass components and examples now use the PatternFly Panel composition (Panel → PanelMain → PanelMainBody).
  • Documentation

    • Compass examples, demos, and component docs updated to reflect Panel composition and updated prop guidance.

@tlabaj tlabaj requested review from a team, mcoker, nicolethoen and wise-king-sullyman and removed request for a team April 22, 2026 20:19
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 22, 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: 2c71ae84-b22c-40e8-815f-bfbc92acc45c

📥 Commits

Reviewing files that changed from the base of the PR and between 2f8b4a1 and c8587ea.

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

Walkthrough

Removed the CompassPanel component and replaced its usages with the shared Panel composition (Panel → PanelMain → PanelMainBody). Added new Panel modifier props (isPill, hasNoBorder, isFullHeight, isGlass, isAutoHeight). Updated Compass components, examples, demos, tests, and bumped PatternFly dev dependency to 6.5.0-prerelease.72.

Changes

Cohort / File(s) Summary
Package version updates
packages/react-core/package.json, packages/react-docs/package.json, packages/react-styles/package.json, packages/react-tokens/package.json
Bumped @patternfly/patternfly devDependency from 6.5.0-prerelease.716.5.0-prerelease.72.
CompassPanel removal & exports
packages/react-core/src/components/Compass/CompassPanel.tsx, packages/react-core/src/components/Compass/index.ts
Deleted CompassPanel module and removed its re-export from the Compass index.
Compass components & docs
packages/react-core/src/components/Compass/CompassContent.tsx, packages/react-core/src/components/Compass/CompassMainHeader.tsx, packages/react-core/src/components/Compass/CompassMainHeaderContent.tsx, packages/react-core/src/components/Compass/examples/Compass.md, packages/react-core/src/components/Compass/examples/CompassBasic.tsx, packages/react-core/src/components/Compass/examples/CompassDockLayout.tsx
Replaced docs/JSDoc references from CompassPanelPanel; updated CompassMainHeader.compassPanelProps type to Omit<PanelProps, 'children'>; updated example usage to use PanelPanelMainPanelMainBody.
Compass tests & demos
packages/react-core/src/components/Compass/__tests__/CompassMainHeader.test.tsx, packages/react-core/src/components/Compass/__tests__/CompassPanel.test.tsx, packages/react-core/src/demos/Compass/examples/CompassDemo.tsx, packages/react-core/src/demos/Compass/examples/CompassDockDemo.tsx
Tests updated to assert Panel class usage; removed CompassPanel test coverage; demos updated to use Panel composition (including replacing hasNoPadding uses with PanelMainBody padding adjustments).
Panel API & tests
packages/react-core/src/components/Panel/Panel.tsx, packages/react-core/src/components/Panel/__tests__/Panel.test.tsx
Added @beta boolean props to PanelProps: isAutoHeight, hasNoBorder, isFullHeight, isGlass, isPill. PanelBase applies corresponding modifier classes; tests extended for these modifiers and snapshots updated.
Panel docs & examples
packages/react-core/src/components/Panel/examples/Panel.md, packages/react-core/src/components/Panel/examples/PanelPill.tsx, packages/react-core/src/components/Panel/examples/PanelScrollableWithAutoHeight.tsx
Added examples and docs entries for "Pill" and "Scrollable with auto height" showcasing new Panel modifiers.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

Possibly related PRs

Suggested reviewers

  • wise-king-sullyman
  • nicolethoen
  • mcoker
🚥 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 clearly describes the primary changes: removing CompassPanel and updating Panel for Compass usage. It directly relates to the substantial refactoring work across multiple files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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 Apr 22, 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.

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

21-24: Consider adding a PanelMainBody prop passthrough for migration parity.

compassPanelProps now only reaches the outer Panel, but the no-padding replacement lives on PanelMainBody. Consumers using the title/toolbar shortcut can’t apply that without switching to custom children and recreating the title/toolbar wrappers.

Possible API extension
 export interface CompassMainHeaderProps extends Omit<React.HTMLProps<HTMLDivElement>, 'title'> {
@@
   compassPanelProps?: Omit<PanelProps, 'children'>;
+  /** Additional props passed to the PanelMainBody that wraps the main header content when using the title or toolbar props. */
+  compassPanelMainBodyProps?: Omit<React.ComponentProps<typeof PanelMainBody>, 'children'>;
 }
 
 export const CompassMainHeader: React.FunctionComponent<CompassMainHeaderProps> = ({
@@
   children,
   compassPanelProps,
+  compassPanelMainBodyProps,
   ...props
 }: CompassMainHeaderProps) => {
@@
       <Panel {...compassPanelProps}>
         <PanelMain>
-          <PanelMainBody>
+          <PanelMainBody {...compassPanelMainBodyProps}>
             <CompassMainHeaderContent>

Also applies to: 37-40

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

In `@packages/react-core/src/components/Compass/CompassMainHeader.tsx` around
lines 21 - 24, The current CompassMainHeader component only exposes
compassPanelProps to the outer Panel but not to the inner PanelMainBody,
preventing consumers from toggling things like no-padding when using
title/toolbar; add a new prop (e.g., compassPanelMainBodyProps?:
Omit<PanelMainBodyProps,'children'>) to the CompassMainHeader props, thread that
prop into the JSX where PanelMainBody is rendered inside CompassMainHeader
(apply the props to the PanelMainBody element), and update the component prop
typing and any usages or tests (also replicate the same change at the other
related spot referenced in the comment) so consumers can pass no-padding and
other PanelMainBody-specific options without needing to provide children.
🤖 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/Compass/CompassMainHeader.tsx`:
- Around line 21-24: The current CompassMainHeader component only exposes
compassPanelProps to the outer Panel but not to the inner PanelMainBody,
preventing consumers from toggling things like no-padding when using
title/toolbar; add a new prop (e.g., compassPanelMainBodyProps?:
Omit<PanelMainBodyProps,'children'>) to the CompassMainHeader props, thread that
prop into the JSX where PanelMainBody is rendered inside CompassMainHeader
(apply the props to the PanelMainBody element), and update the component prop
typing and any usages or tests (also replicate the same change at the other
related spot referenced in the comment) so consumers can pass no-padding and
other PanelMainBody-specific options without needing to provide children.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cbf54911-dac2-4c40-a44d-9489cf0ba7c3

📥 Commits

Reviewing files that changed from the base of the PR and between a426464 and 2f8b4a1.

⛔ Files ignored due to path filters (4)
  • packages/react-core/src/components/Compass/__tests__/__snapshots__/CompassMainHeader.test.tsx.snap is excluded by !**/*.snap
  • packages/react-core/src/components/Compass/__tests__/__snapshots__/CompassPanel.test.tsx.snap is excluded by !**/*.snap
  • packages/react-core/src/components/Panel/__tests__/__snapshots__/Panel.test.tsx.snap is excluded by !**/*.snap
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (21)
  • packages/react-core/package.json
  • packages/react-core/src/components/Compass/CompassContent.tsx
  • packages/react-core/src/components/Compass/CompassMainHeader.tsx
  • packages/react-core/src/components/Compass/CompassMainHeaderContent.tsx
  • packages/react-core/src/components/Compass/CompassPanel.tsx
  • packages/react-core/src/components/Compass/__tests__/CompassMainHeader.test.tsx
  • packages/react-core/src/components/Compass/__tests__/CompassPanel.test.tsx
  • packages/react-core/src/components/Compass/examples/Compass.md
  • packages/react-core/src/components/Compass/examples/CompassBasic.tsx
  • packages/react-core/src/components/Compass/examples/CompassDockLayout.tsx
  • packages/react-core/src/components/Compass/index.ts
  • packages/react-core/src/components/Panel/Panel.tsx
  • packages/react-core/src/components/Panel/__tests__/Panel.test.tsx
  • packages/react-core/src/components/Panel/examples/Panel.md
  • packages/react-core/src/components/Panel/examples/PanelPill.tsx
  • packages/react-core/src/components/Panel/examples/PanelScrollableWithAutoHeight.tsx
  • packages/react-core/src/demos/Compass/examples/CompassDemo.tsx
  • packages/react-core/src/demos/Compass/examples/CompassDockDemo.tsx
  • packages/react-docs/package.json
  • packages/react-styles/package.json
  • packages/react-tokens/package.json
💤 Files with no reviewable changes (3)
  • packages/react-core/src/components/Compass/index.ts
  • packages/react-core/src/components/Compass/tests/CompassPanel.test.tsx
  • packages/react-core/src/components/Compass/CompassPanel.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 nit to remove the class mention in prop description, but otherwise lgtm

variant?: 'raised' | 'bordered' | 'secondary';
/** Flag to add scrollable styling to the panel */
isScrollable?: boolean;
/** @beta When used with a scrollable panel, sets the panel to auto height (scrollable-auto-height modifier) */
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.

Suggested change
/** @beta When used with a scrollable panel, sets the panel to auto height (scrollable-auto-height modifier) */
/** @beta When used with a scrollable panel, sets the panel to auto height */

@jcmill jcmill self-requested a review April 24, 2026 14:37
Copy link
Copy Markdown

@jcmill jcmill left a comment

Choose a reason for hiding this comment

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

LGTM

@thatblindgeye thatblindgeye merged commit 51f4467 into patternfly:main Apr 24, 2026
14 checks passed
@patternfly-build
Copy link
Copy Markdown
Collaborator

Your changes have been released in:

  • @patternfly/react-charts@8.5.0-prerelease.22
  • @patternfly/react-code-editor@6.5.0-prerelease.63
  • @patternfly/react-core@6.5.0-prerelease.60
  • @patternfly/react-docs@7.5.0-prerelease.71
  • @patternfly/react-drag-drop@6.5.0-prerelease.61
  • demo-app-ts@6.5.0-prerelease.89
  • @patternfly/react-styles@6.5.0-prerelease.19
  • @patternfly/react-table@6.5.0-prerelease.63
  • @patternfly/react-templates@6.5.0-prerelease.60
  • @patternfly/react-tokens@6.5.0-prerelease.18

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.

Panel - Glass related react follow up

6 participants