Skip to content

feat(core): track animation settle with data-transitioning lifecycle#1582

Closed
sampotts wants to merge 6 commits into
feat/menu-popup-groupfrom
feat/transition-lifecycle
Closed

feat(core): track animation settle with data-transitioning lifecycle#1582
sampotts wants to merge 6 commits into
feat/menu-popup-groupfrom
feat/transition-lifecycle

Conversation

@sampotts
Copy link
Copy Markdown
Collaborator

@sampotts sampotts commented May 21, 2026

Summary

  • Adds a transitioning flag to createTransition that stays true until open/close animations settle, and exposes it as data-transitioning through popover/menu/tooltip/alert-dialog cores.
  • Restores popover close-animation coordination (setElement, deferred reopen during ending) on top of the transition API changes.
  • Adds generic data-transitioning:overflow-hidden skin hooks for popups and menus (submenu-view selectors remain in the viewport/settings stack).

Transitioning vs status

createTransition state has both status (idle | starting | ending) and a separate transitioning boolean. They are not folded into one field because they answer different questions:

Field Question it answers Drives
status Which CSS style-hook phase are we in? data-starting-style, data-ending-style
transitioning Is motion still in progress (Web Animations / CSS settle)? data-transitioning

On open, status becomes idle after a double-RAF so the browser can paint the “from” state and drop data-starting-style before the enter animation runs—but the popup may still be animating. transitioning stays true until getAnimations({ subtree: true }) settles. That gap (status: idle, transitioning: true) is intentional: style hooks and layout/interaction guards need different lifetimes.

On close, both overlap more (status: ending, transitioning: true), but status still tracks the ending-style hook while transitioning covers the full settle window—including descendant animations and CSS transition fallbacks.

Consumers use data-transitioning for concerns that should span the whole animation (overflow clipping, deferring trigger re-open until close finishes) without overloading status or keeping data-starting-style / data-ending-style active longer than the CSS hooks require.

Stack position

feat/captions-menufeat/menu-popup-group (#1577) → this PRfeat/menu-viewport (#1579) → …

Test plan

  • pnpm build:packages && pnpm typecheck
  • pnpm -F @videojs/core test src/dom/ui/tests/transition.test.ts src/dom/ui/popover
  • Manual: open/close a captions menu and confirm data-transitioning is present during the animation window

Note

Medium Risk
Touches core open/close transition plumbing and popover interaction timing (click/blur/outside-dismiss), which can regress UI dismissal/animation behavior across platforms; changes are well-covered by updated and expanded tests.

Overview
Adds a first-class transitioning lifecycle for UI transitions. TransitionState now includes transitioning, getTransitionFlags/getTransitionStyleAttrs expose it as data-transitioning, and core UI states (PopoverCore, MenuCore, TooltipCore, AlertDialogCore, input indicators) propagate the flag.

Updates DOM transition + popover behavior to respect animation settling. createTransition now tracks a registered element via setElement, waits for getAnimations({ subtree: true }) (plus optional CSS-transition fallback), and keeps transitioning true until settle; createDismissLayer.open() can receive an element. createPopover is adjusted to pass the popup element into open, defer re-open clicks during ending until close completes, and harden blur/outside-dismiss edge cases (incl. group peer-trigger checks).

Skins/presets adopt the new attribute hook. Default/minimal CSS and Tailwind utilities add data-transitioning:overflow-hidden, and React/HTML presets stop composing popup.popover into menu content classes in favor of the menu root styling shell.

Reviewed by Cursor Bugbot for commit 49b4a5b. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

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

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment May 21, 2026 6:06am

Request Review

Comment thread packages/core/src/dom/ui/transition.ts Outdated
Comment thread packages/skins/src/default/tailwind/components/menu.ts Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 5508b22. Configure here.

Comment thread packages/core/src/dom/ui/transition.ts Outdated
sampotts and others added 6 commits May 21, 2026 16:05
Extend createTransition to keep transitioning true until animations settle,
wire the flag through popover/menu/tooltip/alert-dialog cores, restore
popover close-animation coordination, and add generic overflow-hidden skin
hooks for data-transitioning on popups and menus.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Stop scheduleTransitionSettle RAF polling after cleanup runs, and use
data-transitioning:!overflow-hidden so Tailwind can override !overflow-auto.

Co-authored-by: Cursor <cursoragent@cursor.com>
Replace the data-transitioning !overflow-hidden workaround with standalone
menu.root hosts that include the popover positioning shell. Default skin
wraps menu.root with surface at the entry layer and stops layering
popup.popover at call sites.

Co-authored-by: Cursor <cursoragent@cursor.com>
Read the current element when open animations settle so lazy-mounted
popups pick up setElement during the render cycle, and defer
scheduleTransitionSettle to the menu viewport PR where it is used.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant