Skip to content

Conversation

@jonrohan
Copy link
Member

@jonrohan jonrohan commented May 7, 2025

Part of https://github.com/github/primer/issues/3961

I'm going to attempt to break ActionList up into smaller chunks because of the complexity of the component.

Changelog

New

Changed

Removed

Remove the CSS modules feature flag from the ActionList/List 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

Merge checklist

@changeset-bot
Copy link

changeset-bot bot commented May 7, 2025

🦋 Changeset detected

Latest commit: fc1926e

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 May 7, 2025
@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2025

👋 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!

@github-actions
Copy link
Contributor

github-actions bot commented May 7, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 97.03 KB (-0.11% 🔽)
packages/react/dist/browser.umd.js 97.49 KB (-0.06% 🔽)

@primer-integration
Copy link

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

@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 May 7, 2025
@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 7, 2025
@jonrohan jonrohan marked this pull request as ready for review May 7, 2025 19:18
Copilot AI review requested due to automatic review settings May 7, 2025 19:18
@jonrohan jonrohan requested a review from a team as a code owner May 7, 2025 19:18
@jonrohan jonrohan requested a review from francinelucca May 7, 2025 19:18
Copy link
Contributor

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 CSS modules feature flag from the ActionList/List component and simplifies its rendering by consolidating styled variants into a single BoxWithFallback wrapper.

  • Eliminated styled-components and manual sx merging in favor of BoxWithFallback.
  • Removed feature-flag logic around CSS modules and cleaned up related imports.
  • Updated tests to drop feature-flag scenarios and added a changeset entry.

Reviewed Changes

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

File Description
packages/react/src/ActionList/List.tsx Replaced conditional styled/ul branches with BoxWithFallback and removed feature-flag code
packages/react/src/ActionList/ActionList.test.tsx Deleted tests specific to the removed CSS modules feature flag
.changeset/shaggy-states-travel.md Added a changeset to document the removal of the feature flag
Comments suppressed due to low confidence (1)

packages/react/src/ActionList/List.tsx:60

  • Add tests for the new BoxWithFallback implementation to verify that default styling resets are applied and that the component correctly handles ref forwarding.
<BoxWithFallback

)}
<BoxWithFallback
as="ul"
sx={sxProp}
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

Default list styles (margin reset, paddingInlineStart reset, and paddingY for the inset variant) were removed when replacing ListBox. Consider merging the original styles object with sxProp (e.g., sx={merge(styles, sxProp)}) to maintain the intended resets.

Suggested change
sx={sxProp}
sx={merge(
{
margin: 0,
paddingInlineStart: 0,
...(variant === 'inset' && {paddingY: 2}),
},
sxProp,
)}

Copilot uses AI. Check for mistakes.
{childrenWithoutSlots}
</ListBox>
)}
<BoxWithFallback
Copy link

Copilot AI May 7, 2025

Choose a reason for hiding this comment

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

The forwarded ref (forwardedRef or listRef) is no longer passed to BoxWithFallback, which may break focus management and other ref-dependent logic. Pass ref={listRef} (or forwardedRef) to ensure ref forwarding works correctly.

Copilot uses AI. Check for mistakes.
jonrohan and others added 9 commits May 9, 2025 16:27
Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
…nList.Divider component (#6022)

Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
…nList.TrailingAction component (#6021)

Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
…onent (#6014)

Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: Jamie Shark <5520141+jamieshark@users.noreply.github.com>
Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
@jonrohan jonrohan requested a review from a team as a code owner May 9, 2025 16:28
@jonrohan jonrohan requested a review from maximedegreve May 9, 2025 16:28
@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
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 enabled auto-merge May 9, 2025 16:30
@jonrohan jonrohan added this pull request to the merge queue May 9, 2025
Merged via the queue into main with commit 6c2c999 May 9, 2025
35 checks passed
@jonrohan jonrohan deleted the css_modules_remove_flag/actionlist_list branch May 9, 2025 16:52
@primer primer bot mentioned this pull request May 9, 2025
hectahertz pushed a commit that referenced this pull request May 20, 2025
…nList/List component (#6019)

Co-authored-by: Marie Lucca <40550942+francinelucca@users.noreply.github.com>
Co-authored-by: primer[bot] <119360173+primer[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@github.com>
Co-authored-by: Jamie Shark <5520141+jamieshark@users.noreply.github.com>
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 integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm staff Author is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants