Skip to content

Conversation

@francinelucca
Copy link
Member

Component prop handling improvements:

  • In FilteredActionList.tsx, destructured className from textInputProps and renamed the remainder to restTextInputProps for clearer prop management.
  • Updated the TextInput element to use the separated textInputClassName and conditionally apply the FullScreenTextInput class, while spreading only the remaining props. This prevents className from being overridden and ensures correct class application.

@francinelucca francinelucca requested a review from a team as a code owner September 18, 2025 20:43
@changeset-bot
Copy link

changeset-bot bot commented Sep 18, 2025

🦋 Changeset detected

Latest commit: 04c0627

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Patch
@primer/styled-react Patch

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 the staff Author is a staff member label Sep 18, 2025
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 fixes prop handling in the FilteredActionList component to prevent className overrides. The change ensures that the className prop from textInputProps is properly separated and combined with conditional classes, rather than being overridden by the spread operator.

  • Destructures className from textInputProps for explicit handling
  • Updates the TextInput element to use the separated className and apply conditional styling correctly
  • Prevents className override by moving the spread operator after the className prop

loading={loading && !loadingType.appearsInBody}
className={clsx(textInputProps?.className, fullScreenOnNarrow && classes.FullScreenTextInput)}
{...textInputProps}
className={clsx(textInputClassName, {[classes.FullScreenTextInput]: fullScreenOnNarrow})}
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

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

[nitpick] The conditional object syntax {[classes.FullScreenTextInput]: fullScreenOnNarrow} is less readable than the previous fullScreenOnNarrow && classes.FullScreenTextInput pattern. Consider reverting to the more explicit conditional for better readability.

Suggested change
className={clsx(textInputClassName, {[classes.FullScreenTextInput]: fullScreenOnNarrow})}
className={clsx(textInputClassName, fullScreenOnNarrow && classes.FullScreenTextInput)}

Copilot uses AI. Check for mistakes.
@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 Sep 18, 2025
@github-actions
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!

@github-actions github-actions bot requested a deployment to storybook-preview-6879 September 18, 2025 20:51 Abandoned
@francinelucca francinelucca added this pull request to the merge queue Sep 22, 2025
Merged via the queue into main with commit c8fc6b8 Sep 22, 2025
42 checks passed
@francinelucca francinelucca deleted the chore/fix-filtered-action-list-override branch September 22, 2025 17:29
@primer primer bot mentioned this pull request Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants