Skip to content

feat(ToggleGroup): added full width variant#12374

Merged
kmcfaul merged 7 commits intopatternfly:mainfrom
thatblindgeye:iss12373_toggleFill
Apr 24, 2026
Merged

feat(ToggleGroup): added full width variant#12374
kmcfaul merged 7 commits intopatternfly:mainfrom
thatblindgeye:iss12373_toggleFill

Conversation

@thatblindgeye
Copy link
Copy Markdown
Contributor

@thatblindgeye thatblindgeye commented Apr 23, 2026

What: Closes #12373

Additional issues:

Summary by CodeRabbit

  • New Features

    • Added isFill prop to ToggleGroup component for full-width display.
  • Documentation

    • Added full-width toggle group examples and documentation.
  • Tests

    • Added tests for fill modifier class behavior.
  • Chores

    • Updated PatternFly dependencies across packages.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 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

This pull request adds a new isFill prop to the ToggleGroup component to enable full-width styling, applies the corresponding PatternFly modifier class, includes tests validating the new behavior, adds documentation and example usage, and updates the @patternfly/patternfly devDependency across all packages to version 6.5.0-prerelease.75.

Changes

Cohort / File(s) Summary
Dependency version 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
Updated @patternfly/patternfly devDependency versions to 6.5.0-prerelease.75 across all packages.
ToggleGroup component enhancement
packages/react-core/src/components/ToggleGroup/ToggleGroup.tsx
Added optional isFill prop (defaults to false) and applied fill modifier class when enabled.
ToggleGroup tests
packages/react-core/src/components/ToggleGroup/__tests__/ToggleGroup.test.tsx
Added two tests: one verifying fill modifier class is absent by default, another verifying it is present when isFill prop is true.
ToggleGroup documentation and examples
packages/react-core/src/components/ToggleGroup/examples/ToggleGroup.md, packages/react-core/src/components/ToggleGroup/examples/ToggleGroupFill.tsx
Updated markdown documentation with new "Full-width toggle group" section; added new example component demonstrating isFill behavior across three variations (basic, multi-select, with disabled item).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #12282: Updates @patternfly/patternfly devDependency versions across multiple package.json files in a similar fashion.

Suggested reviewers

  • nicolethoen
  • kmcfaul
  • 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 accurately and concisely describes the main change: adding a full-width variant to the ToggleGroup component via the isFill prop.
Linked Issues check ✅ Passed All requirements from issue #12373 are met: isFill prop added to ToggleGroupProps with proper default, fill modifier class applied when isFill is true, and complete full-width toggle examples added with all three variations (basic, multi-select, disabled item).
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the isFill feature for ToggleGroup. The package.json updates to @patternfly/patternfly are supportive dependencies for this feature implementation.
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 Apr 23, 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: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (3)
packages/react-core/src/components/Compass/__tests__/CompassPanel.test.tsx (1)

5-86: ⚠️ Potential issue | 🟠 Major

Mass test.skip masks regressions rather than documenting intent.

Every test in this suite is now skipped, which hides the behavioral regression introduced in CompassPanel.tsx (commented-out modifier classes) from CI. A couple of concerns:

  • Skipped tests accumulate and rarely get re-enabled. If the styling removal is intentional, delete the obsolete assertions; if it's temporary, leave a TODO with an issue link on each test.skip explaining why.
  • The Renders with additional props spread to the component and Renders with children tests do not depend on the removed CSS modifiers and should still pass — no reason to skip them.
  • This change is also outside the stated PR scope (ToggleGroup isFill).
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-core/src/components/Compass/__tests__/CompassPanel.test.tsx`
around lines 5 - 86, The test suite for CompassPanel improperly marks all tests
as skipped, hiding regressions; restore relevant tests and either remove or
document obsolete assertions: re-enable tests that do not depend on removed CSS
modifiers (specifically the "Renders with children" and "Renders with additional
props spread to the component" tests) by removing test.skip on those cases, and
for tests that assert modifier classes (tests referencing styles.compassPanel
and styles.modifiers.* and the snapshot tests), either delete their assertions
if the styling removal is intentional or leave them skipped but replace
test.skip with a commented TODO linking an issue and explaining why (or update
expectations to match the new CompassPanel behavior in CompassPanel.tsx); ensure
you reference the CompassPanel component and the exact test names above when
making changes so CI reflects intended behavior.
packages/react-core/src/components/Compass/CompassPanel.tsx (1)

1-49: ⚠️ Potential issue | 🔴 Critical

Out-of-scope change that silently breaks the CompassPanel public API.

This PR's stated objective is adding an isFill variant to ToggleGroup (issue #12373), but this file disables the entire styling behavior of CompassPanel:

  • The @patternfly/react-styles compass import and all modifier classes (compassPanel, pill, noBorder, noPadding, fullHeight, scrollable) are commented out rather than removed.
  • isPill, hasNoBorder, hasNoPadding, isFullHeight, and isScrollable remain documented in CompassPanelProps and are destructured from props as comments — so consumers can still pass them, but they will be silently ignored and also fall through to the DOM via ...props (causing React unknown-DOM-attribute warnings for the boolean props).
  • Downstream usage such as packages/react-core/src/demos/Compass/examples/CompassDemo.tsx (<CompassPanel isPill hasNoPadding>) and CompassMainHeader (which forwards compassPanelProps) will render without the expected styling.

If these changes are intentional, they should be a separate PR that (a) removes the unused props from CompassPanelProps and the commented-out lines rather than leaving dead code, and (b) updates consumers/snapshots accordingly. Otherwise, please revert this file from the isFill PR.

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

In `@packages/react-core/src/components/Compass/CompassPanel.tsx` around lines 1 -
49, The CompassPanel file accidentally disabled its styling and left boolean
props to leak into the DOM: restore the original behavior by re-enabling the
import from '@patternfly/react-styles/css/components/Compass/compass' (or the
appropriate styles object) and reapply the classnames using styles.compassPanel
and the modifier classes (e.g., styles.modifiers.pill, noBorder, noPadding,
fullHeight, scrollable) inside the css(...) call in CompassPanel; ensure
CompassPanelProps still declares isPill, hasNoBorder, hasNoPadding,
isFullHeight, isScrollable and destructure them from the component signature
(remove them from the spread ...props so they are not passed as unknown DOM
attributes), or if the change was intentional, remove those props from
CompassPanelProps and callers instead and delete the commented lines—update
CompassPanel (and consuming usage like CompassDemo/CompassMainHeader)
accordingly.
packages/react-core/src/components/Compass/__tests__/CompassMainHeader.test.tsx (1)

77-89: ⚠️ Potential issue | 🟠 Major

Skipping these tests hides a real regression.

Both skipped cases assert that CompassPanel renders with the styles.compassPanel class when title/toolbar are passed via CompassMainHeader. Since CompassPanel.tsx no longer applies that class, the tests would fail — skipping them only conceals the behavior change. Either restore the class in CompassPanel or delete these tests (and update the snapshot on line 125-128, which will also capture the regression). As noted above, this looks out of scope for the ToggleGroup isFill PR.

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

In
`@packages/react-core/src/components/Compass/__tests__/CompassMainHeader.test.tsx`
around lines 77 - 89, Tests for CompassMainHeader were skipped but they reveal a
regression: CompassPanel no longer receives the styles.compassPanel class when
title or toolbar is passed, hiding the behavior change; either restore the class
in CompassPanel (ensure CompassPanel component applies styles.compassPanel when
rendered via CompassMainHeader) or remove these tests and update the related
snapshot to reflect the intended output, and re-run tests to confirm
CompassMainHeader and CompassPanel behavior (look for CompassMainHeader,
CompassPanel, and styles.compassPanel in the code to locate the change).
🤖 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/ToggleGroup/examples/ToggleGroup.md`:
- Line 70: Update the heading text "Full width toggle group" to hyphenate the
compound adjective so it reads "Full-width toggle group" wherever that exact
heading appears (e.g., in the ToggleGroup examples markdown heading). Ensure the
updated heading string is used in the ToggleGroup.md example section to reflect
proper compound-adjective styling.

In `@packages/react-core/src/components/ToggleGroup/examples/ToggleGroupFill.tsx`:
- Around line 13-24: The three handlers handleItemClickBasic,
handleItemClickMulti, and handleItemClickDisabled have untyped event parameters;
annotate each event parameter as the union type expected by ToggleGroupItem:
React.MouseEvent<any> | React.KeyboardEvent | MouseEvent (and keep the existing
isSelected: boolean param on handleItemClickMulti), so change the signatures for
handleItemClickBasic(event), handleItemClickMulti(event, isSelected: boolean),
and handleItemClickDisabled(event) to use that union type to satisfy
noImplicitAny; you don't need a default React import—just add the type
annotations to the function parameters.

---

Outside diff comments:
In
`@packages/react-core/src/components/Compass/__tests__/CompassMainHeader.test.tsx`:
- Around line 77-89: Tests for CompassMainHeader were skipped but they reveal a
regression: CompassPanel no longer receives the styles.compassPanel class when
title or toolbar is passed, hiding the behavior change; either restore the class
in CompassPanel (ensure CompassPanel component applies styles.compassPanel when
rendered via CompassMainHeader) or remove these tests and update the related
snapshot to reflect the intended output, and re-run tests to confirm
CompassMainHeader and CompassPanel behavior (look for CompassMainHeader,
CompassPanel, and styles.compassPanel in the code to locate the change).

In `@packages/react-core/src/components/Compass/__tests__/CompassPanel.test.tsx`:
- Around line 5-86: The test suite for CompassPanel improperly marks all tests
as skipped, hiding regressions; restore relevant tests and either remove or
document obsolete assertions: re-enable tests that do not depend on removed CSS
modifiers (specifically the "Renders with children" and "Renders with additional
props spread to the component" tests) by removing test.skip on those cases, and
for tests that assert modifier classes (tests referencing styles.compassPanel
and styles.modifiers.* and the snapshot tests), either delete their assertions
if the styling removal is intentional or leave them skipped but replace
test.skip with a commented TODO linking an issue and explaining why (or update
expectations to match the new CompassPanel behavior in CompassPanel.tsx); ensure
you reference the CompassPanel component and the exact test names above when
making changes so CI reflects intended behavior.

In `@packages/react-core/src/components/Compass/CompassPanel.tsx`:
- Around line 1-49: The CompassPanel file accidentally disabled its styling and
left boolean props to leak into the DOM: restore the original behavior by
re-enabling the import from
'@patternfly/react-styles/css/components/Compass/compass' (or the appropriate
styles object) and reapply the classnames using styles.compassPanel and the
modifier classes (e.g., styles.modifiers.pill, noBorder, noPadding, fullHeight,
scrollable) inside the css(...) call in CompassPanel; ensure CompassPanelProps
still declares isPill, hasNoBorder, hasNoPadding, isFullHeight, isScrollable and
destructure them from the component signature (remove them from the spread
...props so they are not passed as unknown DOM attributes), or if the change was
intentional, remove those props from CompassPanelProps and callers instead and
delete the commented lines—update CompassPanel (and consuming usage like
CompassDemo/CompassMainHeader) accordingly.
🪄 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: d0752e2f-1d10-49fe-a871-9d9abbc9964a

📥 Commits

Reviewing files that changed from the base of the PR and between a426464 and 785dd0c.

⛔ Files ignored due to path filters (3)
  • 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
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (12)
  • packages/react-core/package.json
  • 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/ToggleGroup/ToggleGroup.tsx
  • packages/react-core/src/components/ToggleGroup/__tests__/ToggleGroup.test.tsx
  • packages/react-core/src/components/ToggleGroup/examples/ToggleGroup.md
  • packages/react-core/src/components/ToggleGroup/examples/ToggleGroupFill.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/ToggleGroup/examples/ToggleGroup.md Outdated
Comment thread packages/react-core/src/components/ToggleGroup/examples/ToggleGroupFill.tsx Outdated
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/ToggleGroup/examples/ToggleGroup.md`:
- Line 72: Update the example description string for the ToggleGroup isFill
example to hyphenate compound adjectives: change phrases like "full width",
"single select", and "multi select" to "full-width", "single-select", and
"multi-select" so the sentence reads e.g. "The following example shows
full-width toggle groups for a single-select, multi-select, and single-select
with disabled item." Target the text around the ToggleGroup isFill example in
ToggleGroup.md.(Position reference: the sentence describing full width toggle
groups.)
🪄 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: 4d62b466-47b9-45fc-ab34-9c3c879992a6

📥 Commits

Reviewing files that changed from the base of the PR and between 3e41216 and 7e267af.

📒 Files selected for processing (1)
  • packages/react-core/src/components/ToggleGroup/examples/ToggleGroup.md

Comment thread packages/react-core/src/components/ToggleGroup/examples/ToggleGroup.md Outdated
Copy link
Copy Markdown

@kaylachumley kaylachumley left a comment

Choose a reason for hiding this comment

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

LGTM!

@jcmill jcmill self-requested a review April 24, 2026 15:38
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.

😎

@kmcfaul kmcfaul merged commit bf01ade 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.23
  • @patternfly/react-code-editor@6.5.0-prerelease.64
  • @patternfly/react-core@6.5.0-prerelease.61
  • @patternfly/react-docs@7.5.0-prerelease.72
  • @patternfly/react-drag-drop@6.5.0-prerelease.62
  • @patternfly/react-icons@6.5.0-prerelease.26
  • demo-app-ts@6.5.0-prerelease.90
  • @patternfly/react-styles@6.5.0-prerelease.20
  • @patternfly/react-table@6.5.0-prerelease.64
  • @patternfly/react-templates@6.5.0-prerelease.61
  • @patternfly/react-tokens@6.5.0-prerelease.19

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.

ToggleGroup - add fill/full width modifier

5 participants