Skip to content

fix(core): skip delay when switching between grouped tooltips#903

Merged
sampotts merged 1 commit intomainfrom
feat/tooltips
Mar 12, 2026
Merged

fix(core): skip delay when switching between grouped tooltips#903
sampotts merged 1 commit intomainfrom
feat/tooltips

Conversation

@sampotts
Copy link
Copy Markdown
Collaborator

@sampotts sampotts commented Mar 11, 2026

Summary

  • shouldSkipDelay() returned false when #isOpen was true — this prevented instant tooltip switching because the previous tooltip's async close hadn't fired yet when the next tooltip checked the delay.
  • HTML ContextProvider had no initialValue@lit/context consumers without subscribe: true only get the value at request time. Since TooltipGroupElement set the value in update() (async), tooltips connected before that got undefined and never received the group reference.

Closes #898

Test plan

  • pnpm -F @videojs/core test src/core/ui/tooltip — all 21 tests pass
  • pnpm typecheck — clean
  • pnpm lint — clean
  • Manual: hover between grouped tooltips in video/audio skins — second tooltip should appear instantly (no 600ms delay)

🤖 Generated with Claude Code

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 11, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 840250e
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69b202d973ae73000889071d
😎 Deploy Preview https://deploy-preview-903--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

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

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Mar 12, 2026 0:04am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 11, 2026

📦 Bundle Size Report

🎨 @videojs/html

(no changes)

Presets (7)
Entry Size
/video (default) 21.90 kB
/video (default + hls) 152.30 kB
/video (minimal) 21.75 kB
/video (minimal + hls) 151.99 kB
/audio (default) 20.64 kB
/audio (minimal) 20.66 kB
/background 6.47 kB
Media (4)
Entry Size
/media/background-video 617 B
/media/container 1.91 kB
/media/hls-video 131.23 kB
/media/simple-hls-video 11.91 kB
Players (3)
Entry Size
/video/player 6.33 kB
/audio/player 6.32 kB
/background/player 6.31 kB
Skins (16)
Entry Type Size
/video/minimal-skin.css css 2.58 kB
/video/skin.css css 2.63 kB
/video/minimal-skin js 21.15 kB
/video/minimal-skin.tailwind js 21.33 kB
/video/skin js 21.35 kB
/video/skin.tailwind js 21.57 kB
/audio/minimal-skin.css css 2.17 kB
/audio/skin.css css 2.20 kB
/audio/minimal-skin js 20.10 kB
/audio/minimal-skin.tailwind js 20.04 kB
/audio/skin js 20.13 kB
/audio/skin.tailwind js 20.29 kB
/background/skin.css css 124 B
/background/skin js 999 B
/base.css css 205 B
/shared.css css 35 B
UI Components (21)
Entry Size
/ui/alert-dialog 2.08 kB
/ui/alert-dialog-close 1.29 kB
/ui/alert-dialog-description 1.53 kB
/ui/alert-dialog-title 1.52 kB
/ui/buffering-indicator 1.82 kB
/ui/captions-button 1.79 kB
/ui/controls 1.79 kB
/ui/fullscreen-button 1.80 kB
/ui/mute-button 1.77 kB
/ui/pip-button 1.78 kB
/ui/play-button 1.76 kB
/ui/playback-rate-button 1.83 kB
/ui/popover 3.16 kB
/ui/poster 1.66 kB
/ui/seek-button 1.81 kB
/ui/slider 2.00 kB
/ui/thumbnail 2.10 kB
/ui/time 1.66 kB
/ui/time-slider 2.94 kB
/ui/tooltip 2.42 kB
/ui/volume-slider 2.17 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react

(no changes)

Presets (7)
Entry Size
/video (default) 16.93 kB
/video (default + hls) 147.62 kB
/video (minimal) 16.89 kB
/video (minimal + hls) 147.78 kB
/audio (default) 14.60 kB
/audio (minimal) 14.63 kB
/background 3.19 kB
Media (3)
Entry Size
/media/background-video 539 B
/media/hls-video 131.52 kB
/media/simple-hls-video 12.26 kB
Skins (14)
Entry Type Size
/video/minimal-skin.css css 2.57 kB
/video/skin.css css 2.62 kB
/video/minimal-skin js 16.78 kB
/video/minimal-skin.tailwind js 19.35 kB
/video/skin js 16.80 kB
/video/skin.tailwind js 19.43 kB
/audio/minimal-skin.css css 2.17 kB
/audio/skin.css css 2.19 kB
/audio/minimal-skin js 14.53 kB
/audio/minimal-skin.tailwind js 16.39 kB
/audio/skin js 14.48 kB
/audio/skin.tailwind js 16.59 kB
/background/skin.css css 90 B
/background/skin js 272 B
UI Components (17)
Entry Size
/ui/alert-dialog 2.72 kB
/ui/buffering-indicator 2.19 kB
/ui/captions-button 2.24 kB
/ui/controls 2.19 kB
/ui/fullscreen-button 2.23 kB
/ui/mute-button 2.25 kB
/ui/pip-button 2.23 kB
/ui/play-button 2.24 kB
/ui/playback-rate-button 2.27 kB
/ui/popover 3.08 kB
/ui/poster 2.02 kB
/ui/seek-button 2.25 kB
/ui/slider 3.08 kB
/ui/time 2.32 kB
/ui/time-slider 2.77 kB
/ui/tooltip 3.27 kB
/ui/volume-slider 2.72 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core

(no changes)

Entries (5)
Entry Size
. 4.78 kB
/dom 8.07 kB
/dom/media/custom-media-element 1.76 kB
/dom/media/hls 131.14 kB
/dom/media/simple-hls 11.76 kB

🏷️ @videojs/element

(no changes)

Entries (2)
Entry Size
. 999 B
/context 936 B

📦 @videojs/store

(no changes)

Entries (3)
Entry Size
. 1.32 kB
/html 700 B
/react 360 B

🔧 @videojs/utils

(no changes)

Entries (10)
Entry Size
/array 104 B
/dom 1003 B
/events 227 B
/function 261 B
/object 119 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B

📦 @videojs/spf

(no changes)

Entries (3)
Entry Size
. 40 B
/dom 10.03 kB
/playback-engine 9.93 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes grouped tooltip “hysteresis” so switching between tooltips in the same group can open instantly, and ensures tooltip group context is available synchronously to context consumers.

Changes:

  • Update TooltipGroupCore.shouldSkipDelay() to skip delay while another tooltip in the group is still open.
  • Provide an initialValue for the tooltip group ContextProvider so early consumers don’t receive undefined.
  • Adjust unit tests to reflect the updated skip-delay behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/html/src/ui/tooltip/tooltip-group-element.ts Sets a synchronous initial context value for the tooltip group so consumers can access the group core immediately.
packages/core/src/core/ui/tooltip/tooltip-group-core.ts Changes delay-skipping logic to return true when the group is already open.
packages/core/src/core/ui/tooltip/tests/tooltip-group-core.test.ts Updates expectations/naming around shouldSkipDelay() behavior.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread packages/core/src/core/ui/tooltip/tests/tooltip-group-core.test.ts Outdated
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 left a comment

Choose a reason for hiding this comment

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

Looks like just a test name fix, otherwise looks good!

shouldSkipDelay() returned false when a tooltip was already open, preventing
instant switching. The HTML ContextProvider also lacked an initialValue, so
tooltip elements never received the group reference via @lit/context.

Closes #898

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sampotts sampotts merged commit ff8fb3f into main Mar 12, 2026
19 of 20 checks passed
@sampotts sampotts deleted the feat/tooltips branch March 12, 2026 00:05
@github-actions github-actions bot mentioned this pull request Mar 11, 2026
@luwes luwes mentioned this pull request Apr 11, 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.

Bug: Fix tooltip hysteresis

3 participants