refactor(core)!: 移除持续性的跳转状态 - #595
Merged
Merged
Conversation
`LyricPlayerBase.setIsSeeking` 现已置为空方法,并引入一个默认开启的自动跳转状态推导作为替代
There was a problem hiding this comment.
Pull request overview
此 PR 在 core 层移除了“持续性的跳转(seeking)状态”概念,改为以每次 setCurrentTime 推送为单位推导“本帧是否跳转”,并提供默认开启的自动跳转识别(基于媒体时钟与物理时钟的偏差判断)。同时更新 React 绑定与文档,补充新的跳转说明页面,并新增/调整对应测试覆盖。
Changes:
- Core:废弃
LyricPlayerBase.setIsSeeking的持续状态语义(保留空实现以兼容),新增SeekDetector+ 自动跳转推导开关set/getEnableAutoSeekDetection,并将“停滞/倒退/显式 seek”统一纳入跳转路径处理。 - React:
isSeeking仅作为本次currentTime推送的标注,不再单独触发推送/状态镜像。 - Docs/Tests:新增中英文“跳转与进度对齐”指南页,更新时序指南跳转章节引用;补充 seek detector 与时间线 seek diff 行为测试。
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/lyric-player.tsx | 调整 isSeeking 的语义与 effect 依赖:仅标注 setCurrentTime 推送,不再维护持续状态。 |
| packages/docs/src/content/docs/guides/component/sequence.md | 将跳转说明精简为链接到独立“跳转与进度对齐”页面,并更新 React/Vue 绑定说明。 |
| packages/docs/src/content/docs/guides/component/seeking.md | 新增中文“跳转与进度对齐”完整指南,解释自动推导、显式标记与边界情况。 |
| packages/docs/src/content/docs/en/guides/component/sequence.md | 英文版 sequence 同步更新为链接到独立 seeking 页面,并更新绑定说明。 |
| packages/docs/src/content/docs/en/guides/component/seeking.md | 新增英文“Seeking and Progress Alignment”指南。 |
| packages/docs/astro.config.ts | 将新 seeking 指南加入侧边栏导航。 |
| packages/core/test/timeline-controller.test.ts | 更新/新增跳转相关测试:重复时间视为跳转、跳转帧后恢复等。 |
| packages/core/test/seek-detector.test.ts | 新增 SeekDetector 单元测试覆盖多种节奏/暂停/间隔/倒退场景。 |
| packages/core/test/focus-controller.test.ts | 移除 snapshot 中已删除的 isSeeking 字段初始化。 |
| packages/core/src/lyric-player/base/timeline.ts | 移除 TimelineSnapshot.isSeeking,并调整 diff 标志:hasChanged 与 isTimeJumped 语义更新。 |
| packages/core/src/lyric-player/base/seek-detector.ts | 新增自动跳转推导器(基于 wall clock vs media clock 漂移)。 |
| packages/core/src/lyric-player/base/index.ts | 引入 SeekDetector 与自动推导开关;setCurrentTime 增强(非有限值忽略、暂停相同时间短路等);seek 行为改为以 diff.isTimeJumped 驱动布局策略。 |
| .nx/version-plans/version-plan-1787549320366.md | 记录该 breaking refactor 的版本计划与变更说明。 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LyricPlayerBase.setIsSeeking现已置为空方法,并引入一个默认开启的自动跳转状态推导作为替代