Skip to content

[WEB-4724] feat: tooltip component added to propel package#7613

Merged
sriramveeraghanta merged 4 commits intopreviewfrom
feat-propel-tooltip
Aug 21, 2025
Merged

[WEB-4724] feat: tooltip component added to propel package#7613
sriramveeraghanta merged 4 commits intopreviewfrom
feat-propel-tooltip

Conversation

@anmolsinghbhatia
Copy link
Collaborator

@anmolsinghbhatia anmolsinghbhatia commented Aug 20, 2025

Description

This PR adds the Tooltip component to the Propel UI package.

Summary by CodeRabbit

  • New Features
    • Added a Tooltip component with flexible placement (including start/end variants), alignment, offset, and sensible defaults.
    • Tooltip supports optional heading and rich content, configurable open/close delays, disabled state, and a mobile-friendly mode.
    • Exposed new public entry points for Tooltip and Popover to simplify imports.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Walkthrough

Adds public exports for ./popover and ./tooltip in the Propel package and introduces a new Tooltip module with a position-to-side/align converter and a Tooltip React component that renders via base tooltip primitives (Provider → Root → Trigger → Portal → Positioner → Popup).

Changes

Cohort / File(s) Summary
Public exports update
packages/propel/package.json
Adds exports entries: ./popover./src/popover/index.ts and ./tooltip./src/tooltip/index.ts.
Tooltip module introduction
packages/propel/src/tooltip/index.ts, packages/propel/src/tooltip/root.tsx
Adds index.ts re-exporting ./root; implements root.tsx with TPosition type, convertPlacementToSideAndAlign function, and Tooltip component using base tooltip primitives and props (position/side/align, delays, heading/content, isMobile, etc.).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App
  participant TooltipModule as Tooltip
  participant Base as BaseTooltip (Provider/Root/Trigger)
  participant Portal as Portal
  participant Pos as Positioner
  participant Popup as Popup

  App->>TooltipModule: Render Tooltip(props)
  TooltipModule->>TooltipModule: compute finalSide/finalAlign (convertPlacementToSideAndAlign)
  TooltipModule->>Base: instantiate Provider/Root (openDelay, closeDelay, disabled)
  Base->>Base: render Trigger (children)
  App-->>Base: user hover/focus
  Base->>Portal: mount popup
  Portal->>Pos: position using side/align/offset
  Pos->>Popup: render heading (opt) and content
  App-->>Base: leave/blur or disabled => unmount
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • sriramveeraghanta
  • vamsikrishnamathala

Poem

I nibble on code and hop to the site,
A tooltip appears with a soft, gentle light.
Positions I map, alignments set right,
Popovers ready — I hide out of sight.
A rabbit-approved hint, concise and polite. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fb29e73 and 7bd065e.

📒 Files selected for processing (2)
  • packages/propel/package.json (1 hunks)
  • packages/propel/src/tooltip/root.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/propel/package.json
  • packages/propel/src/tooltip/root.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Analyze (python)
  • GitHub Check: Build and lint web apps
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-propel-tooltip

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Aug 20, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
packages/propel/src/tooltip/root.tsx (4)

44-58: Tighten/align the public type surface; remove unused prop.

  • Make ITooltipProps exportable for consumers.
  • Allow rich content in tooltipHeading (currently string-only).
  • renderByDefault is unused; remove or implement.
-type ITooltipProps = {
-  tooltipHeading?: string;
-  tooltipContent: string | React.ReactNode;
+export type ITooltipProps = {
+  tooltipHeading?: React.ReactNode;
+  tooltipContent: React.ReactNode;
   position?: TPosition;
   children: React.ReactElement;
   disabled?: boolean;
   className?: string;
   openDelay?: number;
   closeDelay?: number;
   isMobile?: boolean;
-  renderByDefault?: boolean;
   side?: Side;
   align?: Align;
   sideOffset?: number;
 };

Follow-up: if renderByDefault is intended, please clarify behavior (e.g., always render portal content for SEO/testing) and wire it into the component; otherwise, delete it to avoid API bloat.


22-24: Export Side and Align types to help consumers with type-safety.

Many consumers will want to type their props or constants consistently with the component API.

-type Side = "top" | "bottom" | "left" | "right";
-type Align = "start" | "center" | "end";
+export type Side = "top" | "bottom" | "left" | "right";
+export type Align = "start" | "center" | "end";

25-42: Clarify “auto” placement semantics or support true auto-placement.

"auto"/"auto-start"/"auto-end" currently map to fixed { side: "bottom", align: ... }. That may surprise consumers expecting true dynamic placement (flip/shift) behavior.

  • If Base UI supports collision-aware placement/flip, consider mapping "auto" to that behavior instead of a fixed side.
  • At minimum, document that "auto*" degrades to bottom-based placements for now.

Would you like me to draft a README snippet documenting placement precedence and current "auto" behavior?


61-66: Great: pure conversion helper invites unit tests.

Consider adding a tiny test matrix to lock the mapping contract.

I can add a test file with cases for every TPosition and the default fallback if desired.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 03479cf and fb29e73.

📒 Files selected for processing (3)
  • packages/propel/package.json (2 hunks)
  • packages/propel/src/tooltip/index.ts (1 hunks)
  • packages/propel/src/tooltip/root.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Analyze (python)
  • GitHub Check: Build and lint web apps
  • GitHub Check: Analyze (javascript)
  • GitHub Check: Build and lint web apps
🔇 Additional comments (3)
packages/propel/package.json (1)

21-22: New popover and tooltip exports verified

Both entry points were confirmed to exist at

  • packages/propel/src/popover/index.ts
  • packages/propel/src/tooltip/index.ts

These exports are wired correctly—approving the changes.

packages/propel/src/tooltip/root.tsx (1)

91-116: Confirm BaseTooltip API props and styling target

I couldn’t find any other usages of BaseTooltip in the repo to cross-reference prop names, so please verify against the package’s TS definitions or docs that:

  • <BaseTooltip.Trigger render={children}> is correct and that Trigger expects a render prop rather than children or a different API.
  • <BaseTooltip.Positioner … render={<BaseTooltip.Popup/>}> is valid and that Positioner accepts both className and render here (some libraries expect the styling on Popup instead).
  • If className belongs on Popup instead of Positioner, move it accordingly to ensure your custom styles actually apply.

Lastly, if you’re creating multiple tooltips under the same tree, consider hoisting a single <BaseTooltip.Provider> to a higher level (e.g. around your app or a section) instead of wrapping each tooltip individually to avoid redundant context providers and potential performance overhead.

packages/propel/src/tooltip/index.ts (1)

1-1: Public re-export looks good.

This cleanly exposes Tooltip and helpers from a stable entry point.

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.

2 participants