Skip to content

refactor(guide-tooltip): migrate GuideTooltip from Flow to TypeScript - #4768

Open
bonchevskyi wants to merge 1 commit into
box:masterfrom
bonchevskyi:refactor/flow-to-ts-guide-tooltip
Open

refactor(guide-tooltip): migrate GuideTooltip from Flow to TypeScript#4768
bonchevskyi wants to merge 1 commit into
box:masterfrom
bonchevskyi:refactor/flow-to-ts-guide-tooltip

Conversation

@bonchevskyi

@bonchevskyi bonchevskyi commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Convert GuideTooltip component to TypeScript

This PR converts src/components/guide-tooltip from JavaScript with Flow to TypeScript.

Changes

  • Finished GuideTooltip.tsx migration with exported GuideTooltipProps interface and JSDoc on every prop
  • Updated index.ts to re-export the component and GuideTooltipProps
  • Converted messages.js to messages.ts and added messages.js.flow for Flow consumers
  • Converted __tests__/GuideTooltip.test.js to GuideTooltip.test.tsx
  • Kept existing GuideTooltip.js.flow / index.js.flow stubs for backward compatibility

Contract

  • Declared Flow props contract preserved (requiredness, accepted values, defaults, exports)

Testing

  • Ran tests for src/components/guide-tooltip; all 4 pass
  • yarn lint:ts and flow check pass
  • Manually verified in Storybook (Components/GuideTooltip) that behavior is unchanged

Summary by CodeRabbit

  • New Features

    • Added localized guide tooltip navigation messages, including step progress information.
    • Improved consistency and clarity of guide tooltip content and navigation labels.
  • Enhancements

    • Guide tooltip options are now more consistently defined, helping ensure reliable rendering across supported configurations.

@bonchevskyi
bonchevskyi requested a review from a team as a code owner August 11, 2026 11:53
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

GuideTooltip now uses an exported TypeScript props interface. Its barrel export and message definitions use TypeScript modules. Tests and story imports no longer use Flow syntax.

Changes

GuideTooltip TypeScript migration

Layer / File(s) Summary
Props contract and exports
src/components/guide-tooltip/GuideTooltip.tsx, src/components/guide-tooltip/index.ts, src/components/guide-tooltip/messages.ts
Defines and exports GuideTooltipProps, updates the component parameter type, re-exports the type, and adds localized navigation messages.
Typed tests and story support
src/components/guide-tooltip/__tests__/GuideTooltip.test.tsx, src/components/guide-tooltip/GuideTooltip.stories.tsx
Migrates test typing from Flow to TypeScript, updates assertions, and replaces the PNG import suppression comment.

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

Possibly related PRs

Suggested labels: ready-to-merge

Suggested reviewers: tjiang-box, vitali-usik

Poem

A rabbit typed each prop with care,
And cleared old Flow marks from the air.
Tests hop in line,
Messages now shine,
GuideTooltip grows TypeScript ears.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the migration of GuideTooltip from Flow to TypeScript.
Description check ✅ Passed The description explains the migration, lists the affected areas, states compatibility requirements, and reports testing results.
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.

🧹 Nitpick comments (1)
src/components/guide-tooltip/GuideTooltip.stories.tsx (1)

7-7: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a checked suppression for the PNG import.

If the PNG import still lacks a module declaration, replace @ts-ignore with @ts-expect-error. Prefer a project-wide *.png declaration when possible.

Proposed change
-// `@ts-ignore` png import has no type declaration
+// `@ts-expect-error`: PNG import has no type declaration
🤖 Prompt for 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.

In `@src/components/guide-tooltip/GuideTooltip.stories.tsx` at line 7, Replace the
unchecked `@ts-ignore` suppression above the PNG import in the GuideTooltip story
with `@ts-expect-error`, or use the project-wide *.png module declaration if one
is available; preserve the import behavior.
🤖 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.

Nitpick comments:
In `@src/components/guide-tooltip/GuideTooltip.stories.tsx`:
- Line 7: Replace the unchecked `@ts-ignore` suppression above the PNG import in
the GuideTooltip story with `@ts-expect-error`, or use the project-wide *.png
module declaration if one is available; preserve the import behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8956490b-0aa5-433d-b37f-fc0b14d4342d

📥 Commits

Reviewing files that changed from the base of the PR and between 5d273fe and 6484b2c.

📒 Files selected for processing (6)
  • src/components/guide-tooltip/GuideTooltip.stories.tsx
  • src/components/guide-tooltip/GuideTooltip.tsx
  • src/components/guide-tooltip/__tests__/GuideTooltip.test.tsx
  • src/components/guide-tooltip/index.ts
  • src/components/guide-tooltip/messages.js.flow
  • src/components/guide-tooltip/messages.ts
💤 Files with no reviewable changes (1)
  • src/components/guide-tooltip/messages.js.flow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant