Skip to content

refactor(pill-cloud): migrate PillCloud from Flow to TypeScript - #4723

Merged
mergify[bot] merged 1 commit into
box:masterfrom
bonchevskyi:refactor/flow-to-ts-pill-cloud
Jul 28, 2026
Merged

refactor(pill-cloud): migrate PillCloud from Flow to TypeScript#4723
mergify[bot] merged 1 commit into
box:masterfrom
bonchevskyi:refactor/flow-to-ts-pill-cloud

Conversation

@bonchevskyi

@bonchevskyi bonchevskyi commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Convert PillCloud component to TypeScript

This PR converts src/components/pill-cloud from JavaScript with Flow to TypeScript.

Changes

  • Converted PillCloud.js to PillCloud.tsx with exported PillCloudProps interface
  • Added exported PillCloudOption interface, replacing the Flow-only Option type imported from pill-selector-dropdown/flowTypes
  • Converted index.js to index.ts, re-exporting the component and its types
  • Converted PillCloud.stories.js to PillCloud.stories.tsx
  • Converted __tests__/PillCloud.test.js to PillCloud.test.tsx
  • Created .js.flow files for backward compatibility
  • Added PillCloud exports to src/components/index.ts

Testing

  • Ran tests for src/components/pill-cloud; all 7 pass with the regenerated snapshot matching the previous output
  • yarn lint:ts and flow check pass
  • Manually verified in Storybook (Components/PillCloud) that pill selection behavior is unchanged

Summary by CodeRabbit

  • New Features
    • Introduced a reusable pill-style selection component that renders configurable options as buttons.
    • Adds selected-state highlighting, optional click-to-select behavior, and support for passing shared button properties.
    • Exposed the component and its option/prop types for easy reuse across the app.
  • Tests
    • Updated tests and stories to use typed option data and verify selected-pill styling behavior.

@bonchevskyi
bonchevskyi requested a review from a team as a code owner July 25, 2026 15:41
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8bd4baac-0813-4cbd-86cf-22ba10f54a83

📥 Commits

Reviewing files that changed from the base of the PR and between ba52acc and 0a7e5ae.

⛔ Files ignored due to path filters (1)
  • src/components/pill-cloud/__tests__/__snapshots__/PillCloud.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (7)
  • src/components/index.ts
  • src/components/pill-cloud/PillCloud.js.flow
  • src/components/pill-cloud/PillCloud.stories.tsx
  • src/components/pill-cloud/PillCloud.tsx
  • src/components/pill-cloud/__tests__/PillCloud.test.tsx
  • src/components/pill-cloud/index.js.flow
  • src/components/pill-cloud/index.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • src/components/pill-cloud/index.ts
  • src/components/pill-cloud/tests/PillCloud.test.tsx
  • src/components/index.ts
  • src/components/pill-cloud/index.js.flow
  • src/components/pill-cloud/PillCloud.stories.tsx
  • src/components/pill-cloud/PillCloud.js.flow
  • src/components/pill-cloud/PillCloud.tsx

Walkthrough

Adds the PillCloud component with typed options, selection handling, button prop forwarding, Flow and TypeScript exports, and updated story and test typing.

Changes

PillCloud component

Layer / File(s) Summary
PillCloud contract, rendering, and exports
src/components/pill-cloud/PillCloud.tsx, src/components/pill-cloud/PillCloud.js.flow, src/components/pill-cloud/index.ts, src/components/pill-cloud/index.js.flow, src/components/index.ts
Defines public option and prop types, renders selectable buttons, forwards button props, and exposes the component through module and barrel exports.
Story typing and selection assertions
src/components/pill-cloud/PillCloud.stories.tsx, src/components/pill-cloud/__tests__/PillCloud.test.tsx
Types story options and state with PillCloudOption and simplifies selected-pill assertions.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: ready-to-merge

Poem

I’m a bunny hopping through the cloud,
Where pill buttons bloom in a colorful crowd.
Selected ones sparkle, clicks softly take flight,
Typed little options keep everything right.
Export the bundle—thump, thump, goodnight!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: migrating PillCloud from Flow to TypeScript.
Description check ✅ Passed The description includes a clear summary, change list, and testing notes, which matches the repository's minimal template requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between dce056d and ba52acc.

⛔ Files ignored due to path filters (1)
  • src/components/pill-cloud/__tests__/__snapshots__/PillCloud.test.tsx.snap is excluded by !**/*.snap
📒 Files selected for processing (7)
  • src/components/index.ts
  • src/components/pill-cloud/PillCloud.js.flow
  • src/components/pill-cloud/PillCloud.stories.tsx
  • src/components/pill-cloud/PillCloud.tsx
  • src/components/pill-cloud/__tests__/PillCloud.test.tsx
  • src/components/pill-cloud/index.js.flow
  • src/components/pill-cloud/index.ts

Comment thread src/components/pill-cloud/PillCloud.tsx
Comment thread src/components/pill-cloud/PillCloud.tsx
@bonchevskyi
bonchevskyi force-pushed the refactor/flow-to-ts-pill-cloud branch from ba52acc to 0a7e5ae Compare July 28, 2026 13:44
@mergify

mergify Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • Entered queue2026-07-28 13:55 UTC · Rule: Automatic strict merge · triggered by rule Automatic merge queue
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-28 13:55 UTC · at 0a7e5ae43fbaf65d98763d8ad0dc3b0ee0a19017 · squash

This pull request spent 21 seconds in the queue, including 3 seconds running CI.

Required conditions to merge
  • github-review-approved [🛡 GitHub branch protection] (documentation)
  • any of [🛡 GitHub branch protection]:
    • check-success = Summary
    • check-neutral = Summary
    • check-skipped = Summary
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_test_build
    • check-neutral = lint_test_build
    • check-skipped = lint_test_build
  • any of [🛡 GitHub branch protection]:
    • check-success = license/cla
    • check-neutral = license/cla
    • check-skipped = license/cla
  • any of [🛡 GitHub branch protection]:
    • check-success = lint_pull_request
    • check-neutral = lint_pull_request
    • check-skipped = lint_pull_request

@mergify
mergify Bot merged commit 66be497 into box:master Jul 28, 2026
10 of 11 checks passed
@mergify mergify Bot removed the queued label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants