refactor(core): 统一时间单位 - #589
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
统一核心模块的时间类型与单位,降低毫秒、秒和时间点混用的风险。
Changes:
- 新增
Duration、MediaTime及类型/运行时测试。 - 将歌词时间线、动画、滚动逻辑迁移至新类型。
- 修复间奏呼吸周期并移除未使用工具。
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
.nx/version-plans/version-plan-1786948536412.md |
添加版本计划 |
packages/core/tsconfig.json |
纳入测试类型检查 |
packages/core/test/time.test.ts |
测试时间运算 |
packages/core/test/time.assert-types.ts |
验证类型约束 |
packages/core/src/utils/time.ts |
实现时间类型 |
packages/core/src/utils/spring.ts |
统一弹簧时长参数 |
packages/core/src/utils/wa-spring.ts |
删除未使用工具 |
packages/core/src/utils/schedule.ts |
删除未使用工具 |
packages/core/src/utils/linear.ts |
删除未使用工具 |
packages/core/src/lyric-player/base/timeline.ts |
类型化时间线 |
packages/core/src/lyric-player/base/scroll.ts |
规范滚动计时 |
packages/core/src/lyric-player/base/index.ts |
转换播放器时间边界 |
packages/core/src/lyric-player/base/group.ts |
类型化组动画 |
packages/core/src/lyric-player/base/line.ts |
类型化行动画 |
packages/core/src/lyric-player/base/interlude-dots.ts |
更新间奏接口 |
packages/core/src/lyric-player/base/bottom-line.ts |
更新底栏接口 |
packages/core/src/lyric-player/dom/index.ts |
传递统一时长 |
packages/core/src/lyric-player/dom/lyric-group.ts |
更新组实现 |
packages/core/src/lyric-player/dom/lyric-line.ts |
更新行实现 |
packages/core/src/lyric-player/dom/interlude-dots.ts |
修复呼吸周期并迁移时间类型 |
packages/core/src/lyric-player/dom/bottom-line.ts |
更新底栏实现 |
packages/core/src/index.ts |
导出时间 API |
packages/docs/src/components/ApiTester/trigger.css |
格式化样式 |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
引入了一个新的
Duration和MediaTime类型,避免到处传递不清不楚的 number 作为时间TARGET_BREATHE_DURATION从1500改为4500是因为 #588 不小心在这里加了* Math.PI修复了数学公式问题,导致每次呼吸时长缩水了 1/π,顺手在这里修了同时移除了没有被使用的几个文件,这样就不用改动里面的时间单位了