Skip to content

fix(Table): pass variant to calculateColumns for radio styling#12451

Open
opacut wants to merge 1 commit into
patternfly:mainfrom
opacut:fix/deprecated-table-compact-radio-padding
Open

fix(Table): pass variant to calculateColumns for radio styling#12451
opacut wants to merge 1 commit into
patternfly:mainfrom
opacut:fix/deprecated-table-compact-radio-padding

Conversation

@opacut

@opacut opacut commented Jun 12, 2026

Copy link
Copy Markdown

Fixes radio button padding in compact variant tables by ensuring the variant
prop is passed to calculateColumns in the deprecated Table component.

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

What: Closes #

Additional issues:

Summary by CodeRabbit

  • Bug Fixes

    • Fixed table column calculation to properly account for the selected variant.
  • Tests

    • Added test coverage for compact table variant with radio selection.

before change:
image

after change:
image

  Fixes radio button padding in compact variant tables by ensuring the variant
  prop is passed to calculateColumns in the deprecated Table component.

  Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The PR adds variant prop forwarding in the Table component and validates it with a snapshot test. calculateColumns now receives the variant value in its options, enabling column calculation to account for table styling variants. A test case covering compact variant with radio row selection is added.

Changes

Variant Prop Forwarding

Layer / File(s) Summary
Variant prop forwarding and snapshot test
packages/react-table/src/deprecated/components/Table/Table.tsx, packages/react-table/src/deprecated/components/Table/__tests__/Table.test.tsx
calculateColumns is called with the variant prop included in its options object. A snapshot test validates Table rendering with compact variant and radio-based row selection together.

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: passing the variant prop to calculateColumns to fix radio button styling in compact table variants.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ 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

patternfly-build commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

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.

2 participants