-
Notifications
You must be signed in to change notification settings - Fork 646
chore(TextInput): Remove the CSS modules feature flag from the TextInput component #5970
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
Conversation
🦋 Changeset detectedLatest commit: d48e4d9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
👋 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! |
size-limit report 📦
|
|
👋 Hi from github/github! Your integration PR is ready: https://github.com/github/github/pull/374840 |
|
🟢 golden-jobs completed with status |
There was a problem hiding this 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 TextInput component and related subcomponents in order to simplify the implementation and remove conditional styling logic. Key changes include replacing toggled styled components with direct usage of BoxWithFallback or native elements, removing feature flag usage in inner visual and action components, and updating tests to reflect these changes.
Reviewed Changes
Copilot reviewed 12 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/internal/components/UnstyledTextInput.tsx | Removed feature flag logic and now always uses BoxWithFallback with CSS Modules. |
| packages/react/src/internal/components/TextInputWrapper.tsx | Simplified styling by removing conditional styled components and merging inline style props. |
| packages/react/src/internal/components/TextInputInnerVisualSlot.tsx | Removed feature flag usage and streamlined the spinner/visual slot structure. |
| packages/react/src/internal/components/TextInputInnerAction.tsx | Eliminated conditional style props based on feature flag, now using a consistent style for invisible controls. |
| packages/react/src/tests/* | Updated/removes tests that relied on feature flag behavior (with some tests skipped). |
| packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx | Removed feature flag usage and replaced Box usage with native elements and CSS modules accordingly. |
| .changeset/empty-cooks-love.md | Documented the removal of the CSS modules feature flag. |
Files not reviewed (3)
- packages/react/src/TextInputWithTokens/TextInputWithTokens.module.css: Language not supported
- packages/react/src/internal/components/TextInputInnerAction.module.css: Language not supported
- packages/react/src/internal/components/TextInputInnerVisualSlot.module.css: Language not supported
Comments suppressed due to low confidence (3)
packages/react/src/internal/components/TextInputWrapper.tsx:75
- Verify that merging inline style props in this conditional statement preserves the intended precedence of user-supplied styles, especially for width-related properties.
style={ typeof width === 'string' || typeof minWidth === 'string' || typeof maxWidth === 'string' ? {width, maxWidth, minWidth, ...style} : style }
packages/react/src/tests/Textarea.test.tsx:66
- The test for the optional block prop is now skipped; confirm that this prop is either deprecated or covered elsewhere to ensure adequate test coverage.
it.skip('renders an optional block prop correctly', () => {
packages/react/src/TextInputWithTokens/TextInputWithTokens.tsx:282
- Switching from the Box component to a native div changes the element semantics; please verify that all associated layout and style behaviors continue to work as expected.
<div className={styles.Container} data-prevent-token-wrapping={preventTokenWrapping}>
Closes https://github.com/github/primer/issues/4365
Changelog
New
Changed
Removed
Remove the CSS modules feature flag from the TextInput component
Rollout strategy
Testing & Reviewing
Merge checklist