Skip to content

chore(RadioGroup): migrate to CSS Modules with visual regression baseline#1086

Open
DreaminDani wants to merge 2 commits into
mainfrom
chore/migrate-radio-group-css-modules
Open

chore(RadioGroup): migrate to CSS Modules with visual regression baseline#1086
DreaminDani wants to merge 2 commits into
mainfrom
chore/migrate-radio-group-css-modules

Conversation

@DreaminDani

@DreaminDani DreaminDani commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Commits

  • test(RadioGroup): add visual regression baseline before CSS Modules migration — adds stories, Playwright spec, and fresh PNG snapshots that capture the current rendering.
  • chore(RadioGroup): migrate styling from styled-components to CSS Modules — replaces styled-components with .module.css + cva/cn. DOM-identical, byte-for-byte visual parity verified.

Verification

  • yarn test:visual tests/forms/radiogroup.spec.ts passes with zero snapshot regenerations (21 tests)
  • yarn test RadioGroup, yarn lint:css, yarn lint:code, yarn format, yarn build all green
  • grep -r 'styled-components' src/components/RadioGroup/ empty (only the original FormRoot/GenericLabel/Label/Error building blocks from @/components/FormContainer stay as-is, matching the already-migrated Checkbox precedent)

Note

Low Risk
Presentation-only refactor with visual regression coverage; public props and Radix behavior are intended to stay unchanged aside from styling specificity fixes for FormRoot.

Overview
RadioGroup styling moves off styled-components onto CSS Modules (RadioGroup.module.css) with cva/cn for inline/error layout variants, while Radix and existing FormRoot wiring stay the same. Items use module classes (including a .item.item specificity hook so layout overrides still win over FormRoot), and className is forwarded on the group and items.

Storybook gains dedicated stories (checked, disabled, inline/vertical, label/error, etc.) to lock appearance, and a new Playwright suite (tests/forms/radiogroup.spec.ts) adds light/dark screenshots plus hover, focus, and basic a11y checks. A patch changeset records no intended behavior change.

Reviewed by Cursor Bugbot for commit 50c76a0. Bugbot is set up for automated code reviews on this repo. Configure here.

DreaminDani and others added 2 commits June 18, 2026 10:21
…igration

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Storybook Preview Deployed

✅ Preview URL: https://click-6fsqbwzmd-clickhouse.vercel.app

Built from commit: b0c507cae759096c37180b1819e589a3c105a363

Copilot AI left a comment

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.

Pull request overview

This PR migrates the RadioGroup component’s styling from styled-components to CSS Modules while adding Storybook stories and Playwright visual regression coverage to preserve rendering parity across themes and states.

Changes:

  • Added Playwright visual regression spec for RadioGroup (light/dark, states, hover/focus, basic a11y checks).
  • Replaced styled-components styles in RadioGroup with RadioGroup.module.css and cva/cn-driven class composition.
  • Added/expanded Storybook stories and included a patch changeset documenting the migration.

Reviewed changes

Copilot reviewed 5 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/forms/radiogroup.spec.ts Adds visual regression + interactive/a11y Playwright coverage for RadioGroup.
src/components/RadioGroup/RadioGroup.tsx Migrates component styling to CSS Modules and forwards className.
src/components/RadioGroup/RadioGroup.stories.tsx Adds dedicated stories to lock in baseline visuals for tests.
src/components/RadioGroup/RadioGroup.module.css New CSS Module implementing former styled-components rules + specificity handling.
.changeset/migrate-radio-group-to-css-modules.md Patch changeset describing the migration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/RadioGroup/RadioGroup.tsx
Comment thread src/components/RadioGroup/RadioGroup.tsx
Comment thread src/components/RadioGroup/RadioGroup.module.css
Comment thread .changeset/migrate-radio-group-to-css-modules.md
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