refactor(select): migrate Select from Flow to TypeScript - #4745
refactor(select): migrate Select from Flow to TypeScript#4745bonchevskyi wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdded a typed ChangesSelect component
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Select
participant PlainButton
participant Tooltip
User->>Select: Render select and optional info control
User->>PlainButton: Click info control
PlainButton->>Select: Trigger tooltip visibility update
Select->>Tooltip: Render updated tooltip state
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/select/Select.tsx`:
- Line 75: Use a single combined disabled state in Select for both styling and
the native control: destructure the native disabled prop so it cannot remain in
rest, combine it with isDisabled, and apply that value to the classes and select
element. Make the equivalent change in src/components/select/Select.tsx (lines
75-75) and src/components/select/Select.js.flow (lines 60-60).
- Around line 66-77: Associate the validation error with the focusable select
rather than the wrapper span: update the select in
src/components/select/Select.tsx lines 66-77 to receive the Tooltip ARIA
attributes, set aria-invalid based on error, and add coverage for the select’s
ARIA attributes. Apply the same accessibility changes to
src/components/select/Select.js.flow lines 56-62 to keep both implementations
aligned.
- Line 33: Update the SelectProps definition for name to remain optional while
preserving the existing string Flow type contract, matching the component’s
undefined-name behavior and Select.js.flow. Do not make name required unless you
also change the runtime behavior, tests, and corresponding Flow declaration
consistently.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 271c28bb-0258-46be-a269-5b62372880ab
⛔ Files ignored due to path filters (1)
src/components/select/__tests__/__snapshots__/Select.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (9)
src/components/index.tssrc/components/select/Select.js.flowsrc/components/select/Select.stories.tsxsrc/components/select/Select.tsxsrc/components/select/__tests__/Select.test.tsxsrc/components/select/index.js.flowsrc/components/select/index.tssrc/components/select/messages.js.flowsrc/components/select/messages.ts
💤 Files with no reviewable changes (1)
- src/components/select/Select.stories.tsx
a7cf75e to
8e5658b
Compare
8e5658b to
bdecd95
Compare
bdecd95 to
a60933f
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
a60933f to
7449f45
Compare
7449f45 to
548cdad
Compare
Convert
Selectcomponent to TypeScriptThis PR converts
src/components/selectfrom JavaScript with Flow to TypeScript.Changes
Select.jstoSelect.tsxwith exportedSelectPropsinterfaceindex.jstoindex.ts, re-exporting the component and its typesSelect.stories.jstoSelect.stories.tsx__tests__/Select.test.jstoSelect.test.tsx.js.flowfiles for backward compatibilitySelectexports tosrc/components/index.tsTesting
src/components/select; all 13 pass with snapshots matching previous outputyarn lint:tsandyarn flow checkpassSummary by CodeRabbit