refactor(pill-cloud): migrate PillCloud from Flow to TypeScript - #4723
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 ignored due to path filters (1)
📒 Files selected for processing (7)
🚧 Files skipped from review as they are similar to previous changes (7)
WalkthroughAdds the ChangesPillCloud component
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: 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: 2
🤖 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/pill-cloud/PillCloud.tsx`:
- Around line 27-37: Protect internally controlled props in both PillCloud
implementations: update PillCloud in src/components/pill-cloud/PillCloud.tsx
(lines 27-37) and src/components/pill-cloud/PillCloud.js.flow (lines 16-27) so
buttonProps cannot replace the generated pill classes, onSelect behavior, or
resin target. Merge buttonProps.className with the generated className, merge
its onClick with the internal selection callback, and place buttonProps before
the generated props so data-resin-target remains controlled.
- Around line 8-13: Update PillCloudOption and the PillCloud rendering logic so
each option uses a guaranteed unique, non-null identifier for both the React key
and data-resin-target instead of nullable, potentially duplicated value. Prefer
making the existing id required and enforcing uniqueness, or validate and reject
invalid duplicate/null identifiers; add regression tests covering duplicate and
null values.
🪄 Autofix (Beta)
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: 7069b18c-8b79-4e1a-8467-f0179ff9ef80
⛔ Files ignored due to path filters (1)
src/components/pill-cloud/__tests__/__snapshots__/PillCloud.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (7)
src/components/index.tssrc/components/pill-cloud/PillCloud.js.flowsrc/components/pill-cloud/PillCloud.stories.tsxsrc/components/pill-cloud/PillCloud.tsxsrc/components/pill-cloud/__tests__/PillCloud.test.tsxsrc/components/pill-cloud/index.js.flowsrc/components/pill-cloud/index.ts
ba52acc to
0a7e5ae
Compare
Merge Queue Status
This pull request spent 21 seconds in the queue, including 3 seconds running CI. Required conditions to merge
|
Convert PillCloud component to TypeScript
This PR converts
src/components/pill-cloudfrom JavaScript with Flow to TypeScript.Changes
PillCloud.jstoPillCloud.tsxwith exportedPillCloudPropsinterfacePillCloudOptioninterface, replacing the Flow-onlyOptiontype imported frompill-selector-dropdown/flowTypesindex.jstoindex.ts, re-exporting the component and its typesPillCloud.stories.jstoPillCloud.stories.tsx__tests__/PillCloud.test.jstoPillCloud.test.tsx.js.flowfiles for backward compatibilityPillCloudexports tosrc/components/index.tsTesting
src/components/pill-cloud; all 7 pass with the regenerated snapshot matching the previous outputyarn lint:tsandflow checkpassComponents/PillCloud) that pill selection behavior is unchangedSummary by CodeRabbit