Skip to content

chore(SegmentedControl): Remove the CSS modules feature flag from the SegmentedControl component #5933

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 9, 2025

Conversation

jonrohan
Copy link
Member

@jonrohan jonrohan commented Apr 16, 2025

Closes https://github.com/github/primer/issues/3917

Changelog

New

Changed

Removed

Remove the CSS modules feature flag from the SegmentedControl component

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Shouldn't have any visual effect on production.

Merge checklist

Copy link

changeset-bot bot commented Apr 16, 2025

🦋 Changeset detected

Latest commit: fe97485

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Apr 16, 2025
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

Copy link
Contributor

github-actions bot commented Apr 16, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 96 KB (-0.59% 🔽)
packages/react/dist/browser.umd.js 96.2 KB (-0.66% 🔽)

@github-actions github-actions bot temporarily deployed to storybook-preview-5933 April 16, 2025 18:15 Inactive
@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Apr 16, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-5933 April 22, 2025 00:46 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-5933 April 22, 2025 01:00 Inactive
@primer-integration
Copy link

👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/377284

@github-actions github-actions bot temporarily deployed to storybook-preview-5933 May 9, 2025 20:14 Inactive
@primer-integration
Copy link

🟢 golden-jobs completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels May 9, 2025
@jonrohan jonrohan marked this pull request as ready for review May 9, 2025 21:02
@Copilot Copilot AI review requested due to automatic review settings May 9, 2025 21:02
@jonrohan jonrohan requested a review from a team as a code owner May 9, 2025 21:02
@jonrohan jonrohan requested a review from joshblack May 9, 2025 21:02
@jonrohan jonrohan enabled auto-merge May 9, 2025 21:02
Copy link
Contributor

@Copilot Copilot AI left a comment

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 removes the legacy CSS modules feature flag and styled-components toggles from the SegmentedControl suite, consolidating all styling in CSS modules and the BoxWithFallback component.

  • Eliminated the getSegmentedControlStyles file and its related feature flag.
  • Replaced all toggleStyledComponent and styled usages in SegmentedControl, SegmentedControlButton, and SegmentedControlIconButton with BoxWithFallback and CSS module classes.
  • Updated CSS to include a new .LeadingIcon rule for consistent icon spacing.

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/SegmentedControl/getSegmentedControlStyles.ts Deleted—removed the old style generator and feature flag.
packages/react/src/SegmentedControl/SegmentedControlIconButton.tsx Swapped styled-component logic for BoxWithFallback + CSS modules.
packages/react/src/SegmentedControl/SegmentedControlButton.tsx Swapped styled-component logic for BoxWithFallback + CSS modules.
packages/react/src/SegmentedControl/SegmentedControl.tsx Replaced the toggled ul and inline styles with BoxWithFallback.
packages/react/src/SegmentedControl/SegmentedControl.module.css Added .LeadingIcon for icon margin.
.changeset/chilled-camels-obey.md Added changeset for minor release.

@jonrohan jonrohan requested a review from joshblack May 9, 2025 21:07
Copy link
Contributor

github-actions bot commented May 9, 2025

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label May 9, 2025
@github-actions github-actions bot requested a deployment to storybook-preview-5933 May 9, 2025 21:13 Abandoned
Copy link
Contributor

github-actions bot commented May 9, 2025

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@jonrohan jonrohan removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label May 9, 2025
@jonrohan jonrohan added this pull request to the merge queue May 9, 2025
Merged via the queue into main with commit ed6e947 May 9, 2025
36 checks passed
@jonrohan jonrohan deleted the css_modules_remove_flag/segmentedcontrol branch May 9, 2025 21:48
hectahertz pushed a commit that referenced this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh staff Author is a staff member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants