Agent Skills › videojs/video.js › implement-ui-transition

implement-ui-transition

GitHub

指导实现UI过渡动画,涵盖生命周期管理、取消处理及HTML/React框架适配。确保CSS控制动效,保持状态一致性并处理竞态条件与无障碍模式。

.agents/skills/implement-ui-transition/SKILL.md videojs/video.js

触发场景

实现UI组件的进入或退出动画 修复UI过渡中的状态不同步问题 适配HTML或React框架的过渡逻辑

安装

npx skills add videojs/video.js --skill implement-ui-transition -g -y
更多选项

非标准路径

npx skills add https://github.com/videojs/video.js/tree/main/.agents/skills/implement-ui-transition -g -y

不安装直接使用

npx skills use videojs/video.js@implement-ui-transition

指定 Agent (Claude Code)

npx skills add videojs/video.js --skill implement-ui-transition -a claude-code -g -y

安装 repo 全部 skill

npx skills add videojs/video.js --all -g -y

预览 repo 内 skill

npx skills add videojs/video.js --list

SKILL.md

Frontmatter
{
    "name": "implement-ui-transition",
    "description": "Implement UI transitions and rendered presence. Use for lifecycle, cancellation, rapid reopen, or HTML\/React parity."
}

UI transition implementation

Read packages/core/src/core/ui/transition.ts, packages/core/src/dom/ui/transition.ts, their tests, and the nearest HTML and React integrations before changing transition behavior. Popover is the general open/close example; input indicators cover payload retention during exit.

Workflow

  1. Define logical state, rendered presence, transition completion, and the lifetime of focus, payload, locks, and callbacks.
  2. Reuse TransitionState, TransitionDataAttrs, and createTransition. Do not add component-local timers or framework-only presence state for the shared lifecycle.
  3. Apply data-starting-style before the first visible frame. Keep content active during data-ending-style; let CSS own duration, easing, transforms, and other presentation.
  4. Adapt the same transition state into HTML and React. Keep immediate change callbacks distinct from completion callbacks, and retain data needed to render the exiting state.
  5. Handle no-animation completion, cancellation, rapid reopen, repeated updates during exit, disconnect, and destroy. Never infer completion from a fixed CSS duration.
  6. Add CSS custom properties only for dynamic geometry or values consumers need for styling. Preserve a usable reduced-motion path without changing semantic state or focus order.
  7. Test state and data-attribute ordering, presence through exit, completion, races, cleanup, and platform parity. Verify the rendered transition in a browser when timing or layout matters.

Use packages/core/src/dom/ui/tests/transition.test.ts, packages/core/src/dom/ui/popover/, packages/html/src/ui/popover/, packages/react/src/ui/popover/, and the input-indicator implementations as comparison anchors.

Example

Input: “Keep the chapter indicator mounted while its exit animation completes.”

Output: Shared presence state, stable exiting content, CSS-owned motion, race-safe cleanup, matching adapters, and focused tests.

版本历史

  • 8a0a3d8 当前 2026-10-20 08:03

同 Skill 集合

.agents/skills/change-spf-behavior/SKILL.md
.agents/skills/commit-pr/SKILL.md
.agents/skills/configure-vite-plus/SKILL.md
.agents/skills/create-html-component/SKILL.md
.agents/skills/create-issue/SKILL.md
.agents/skills/create-react-component/SKILL.md
.agents/skills/create-skill/SKILL.md
.agents/skills/create-spf-behavior/SKILL.md
.agents/skills/design-api/SKILL.md
.agents/skills/document-spf-feature/SKILL.md
.agents/skills/document-spf-use-case/SKILL.md
.agents/skills/implement-accessible-ui/SKILL.md
.agents/skills/implement-spf-feature/SKILL.md
.agents/skills/implement-spf-use-case/SKILL.md
.agents/skills/investigate-issue/SKILL.md
.agents/skills/maintain-agent-docs/SKILL.md
.agents/skills/maintain-tests/SKILL.md
.agents/skills/maintain-vjsc-skin-gaps/SKILL.md
.agents/skills/review-accessibility/SKILL.md
.agents/skills/review-api/SKILL.md
.agents/skills/review-branch/SKILL.md
.agents/skills/review-docs/SKILL.md
.agents/skills/review-html-component-design/SKILL.md
.agents/skills/review-html-component/SKILL.md
.agents/skills/review-react-component-design/SKILL.md
.agents/skills/review-react-component/SKILL.md
.agents/skills/write-api-reference/SKILL.md
.agents/skills/write-design-doc/SKILL.md
.agents/skills/write-docs/SKILL.md
.agents/skills/write-html-component-design/SKILL.md
.agents/skills/write-locale-translations/SKILL.md
.agents/skills/write-react-component-design/SKILL.md
.agents/skills/write-rfc/SKILL.md
.agents/skills/create-rolldown-plugin/SKILL.md
.agents/skills/create-vite-plugin/SKILL.md
.agents/skills/create-vjsc-component/SKILL.md
.agents/skills/transform-rolldown-code/SKILL.md

元信息

文件数
0
版本
8a0a3d8
Hash
ad186d57
收录时间
2026-10-20 08:03

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-04 13:20
浙ICP备14020137号-1