fix(packages): keep controls visible during active interactions - #1900
fix(packages): keep controls visible during active interactions#1900mihar-22 wants to merge 2 commits into
Conversation
✅ Deploy Preview for vjs10-site ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📦 Bundle Size Report🎨 @videojs/html
Presets (7)
Media (12)
Players (5)
Skins (30)
UI Components (39)
Sizes are marginal over the root entry point. ⚛️ @videojs/react — no changesPresets (7)
Media (11)
Skins (27)
UI Components (33)
Sizes are marginal over the root entry point. 🧩 @videojs/core — no changesEntries (73)
🏷️ @videojs/element — no changesEntries (2)
📦 @videojs/store — no changesEntries (3)
🔧 @videojs/utils — no changesEntries (12)
📦 @videojs/media — no changesEntries (14)
📦 @videojs/spf — no changesEntries (5)
ℹ️ How to interpretJS sizes are initial static graph totals (minified + brotli). Lazy dynamic chunks are shown separately when present.
Run |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 90390c9. Configure here.
| this.#releaseControlsLock ??= this.#controlsState.value?.requestControlsLock() ?? null; | ||
| } else { | ||
| this.#releaseControlsVisibilityLock(); | ||
| } |
There was a problem hiding this comment.
Stale controls locks after attach
Medium Severity
HTML menu and slider elements cache the first requestControlsLock() result with ??=. Before store.attach(), and again after detach/reattach, that API is the fallback no-op release. Once stored, later updates never call the real lock even though requestControlsLock was replaced, so controls can still auto-hide while a root menu stays open or a drag is active. React avoids this by depending on the function identity and re-running the effect.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 90390c9. Configure here.


Closes #1890
Summary
Prevent player controls from auto-hiding while a menu is open or a slider drag is active. The behavior is shared by the HTML and React renderers, and the normal idle delay resumes after the final interaction ends.
vjs-menu-no-close.mp4
Changes
Testing
Known unrelated failure: pnpm typecheck reports packages/html/src/icons/tests/index.test.ts:18 because playIcon is not exported.
Note
Medium Risk
Changes shared auto-hide logic in
controlsFeatureand every menu/slider path; behavior is well covered by unit and e2e tests but regressions could affect all players using these controls.Overview
Fixes controls auto-hiding mid-interaction by adding
requestControlsLock()on player controls state: a reference-counted hold that forcescontrolsVisible, pauses the idle timer, and after the last release restarts a full inactivity window instead of hiding immediately.controlsFeaturetreats active locks like paused/cast when computing visibility; detach clears outstanding locks. Menus and sliders call the API for the whole interaction (open/close or drag start/end), including teardown on disconnect.HTML root
MenuElementand generic, time, and volume slider elements acquire viaPlayerController. React mirrors this inMenuRootanduseSlider. Design docs now describe locks; they are no longer listed as alpha descope.E2E asserts the bar stays visible with settings open and during a stationary time-slider drag past the normal hide delay.
Reviewed by Cursor Bugbot for commit 90390c9. Bugbot is set up for automated code reviews on this repo. Configure here.