Skip to content

feat: add tooltip core - #212

Merged
luwes merged 9 commits into
mainfrom
tooltip-core
Dec 6, 2025
Merged

feat: add tooltip core#212
luwes merged 9 commits into
mainfrom
tooltip-core

Conversation

@luwes

@luwes luwes commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator
  • add check collision logic to popover
  • make use in React tooltip wrapper

@luwes luwes self-assigned this Dec 3, 2025
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 3, 2025 04:22 Inactive
@vercel

vercel Bot commented Dec 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
vjs-10-demo-html Ready Ready Preview Comment Dec 5, 2025 0:00am
vjs-10-demo-next Ready Ready Preview Comment Dec 5, 2025 0:00am
vjs-10-demo-react Ready Ready Preview Comment Dec 5, 2025 0:00am
vjs-10-website Ready Ready Preview Comment Dec 5, 2025 0:00am

@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 3, 2025 04:22 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 3, 2025 04:50 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 3, 2025 04:50 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 3, 2025 04:50 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 3, 2025 04:51 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 18:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 18:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 18:58 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 4, 2025 18:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 21:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 21:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 21:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 4, 2025 21:09 Inactive
@luwes luwes changed the title feat: add tooltip core (WIP) feat: add tooltip core Dec 4, 2025
@luwes
luwes marked this pull request as ready for review December 4, 2025 21:13
@luwes
luwes requested a review from Copilot December 4, 2025 21:14

Copilot AI 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.

Pull request overview

This PR adds tooltip functionality to the core library and integrates collision detection logic into the popover system. The tooltip component extends the existing popover implementation with tooltip-specific defaults (hover-only behavior) while leveraging the new collision detection capabilities.

Key changes:

  • Moved math utilities (Point interface, line projection, distance) from slider component to shared utils for reuse
  • Added collision detection to popover core that calculates boundary adjustments and positioning constraints
  • Created tooltip component as a wrapper around popover with tooltip-specific defaults
  • Updated React and HTML implementations to use the new core components

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/utils/src/shared/string.ts Added toKebabCase utility function for converting camelCase to kebab-case
packages/utils/src/shared/math.ts Moved Point interface and geometric calculation utilities from slider to shared utils
packages/utils/src/index.ts Exported new math utilities module
packages/utils/src/dom/element.ts Added translate handling functions and renamed getBoundingClientRectWithoutTransform
packages/utils/src/dom/attributes.ts Updated style property setter to use kebab-case conversion
packages/react/src/utils/use-mutation-observer.ts Added React hook for observing DOM mutations
packages/react/src/components/Tooltip.tsx Refactored to use core tooltip implementation with component factory pattern
packages/react/src/components/Popover.tsx Updated to use computed popover styles from core state
packages/html/src/elements/volume-slider.ts Fixed anchor-name style property to use camelCase
packages/html/src/elements/tooltip.ts Refactored to use core tooltip implementation
packages/html/src/elements/time-slider.ts Fixed anchor-name style property to use camelCase
packages/html/src/elements/popover.ts Updated to use computed popover styles from core state
packages/core/src/index.ts Exported new Tooltip component and state
packages/core/src/components/tooltip.ts Added core tooltip component extending popover
packages/core/src/components/slider.ts Removed geometric utilities (moved to shared utils)
packages/core/src/components/popover.ts Added collision detection logic and cursor tracking support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/utils/src/shared/string.ts
Comment thread packages/utils/src/shared/math.ts
Comment thread packages/core/src/components/popover.ts
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 21:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 21:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 21:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 4, 2025 21:26 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 23:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 23:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 23:12 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 4, 2025 23:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 23:37 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 23:37 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 23:37 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 4, 2025 23:38 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 23:42 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 23:42 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 23:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 4, 2025 23:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-html December 4, 2025 23:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-react December 4, 2025 23:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-demo-next December 4, 2025 23:59 Inactive
@vercel
vercel Bot temporarily deployed to Preview – vjs-10-website December 5, 2025 00:00 Inactive
@luwes
luwes merged commit cbf41ce into main Dec 6, 2025
7 checks passed
@luwes
luwes deleted the tooltip-core branch December 6, 2025 02:18
@github-actions github-actions Bot mentioned this pull request Dec 6, 2025
@github-actions github-actions Bot mentioned this pull request Feb 26, 2026
@github-actions github-actions Bot mentioned this pull request Mar 10, 2026
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