Repository navigation
fix(reader): 返回原进度后恢复 TTS 跟读跟随 - #47
Merged
Merged
Conversation
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.
解决的问题 / Problem
Fixes #45
使用文本 TTS 听书时,通过目录跳到其它章节,再点击「返回原进度」回到原阅读位置后,页面上的朗读句虽然仍在继续播放,但跟读跟随状态丢失(
followEnabled仍为关闭),后续朗读不再自动翻页。原因是
restoreJumpOrigin只调用了cancelFollowIfActive(),没有像手动翻页、进度条跳页、目录跳章那样在落点重新判定「跟读页」;同时resumeTarget精确定位尚未落定时页码仍是暂态值,提前判定会误判。改动后的行为 / Resulting behavior
resumeTarget)未落定前保持判定挂起,等页码/滚动位置真正落定后再补判,避免按旧页码误恢复。验证 / Validation
pnpm exec tsc --noEmit通过。pnpm run i18n:check通过(中文 1406 条、英文基础 key 1406 条)。pnpm build通过。node scripts/tts-follow-recovery-test.mjs通过,新增单/双页返回跟读屏、落点非朗读屏、暂态页码不提前恢复、跨章返回、章首返回等用例;并已做变异验证:移除修复后该脚本在「返回原进度落回跟读屏后恢复跟随」处失败。reader-page-turn-test、reader-position-transition-test、reader-auto-page-test、tts-segment-test、tts-timer-test均通过。tts-replacements-test在与构建并行首跑时出现一次请求顺序断言失败,单独重跑 3 次均通过;该脚本不涉及本次改动,判断为既有并发时序波动。数据与兼容性 / Data and compatibility
不涉及 / N/A。未修改持久化格式、迁移或书源引擎;仅调整阅读页 TTS 跟读恢复判定。
提交前检查 / Checklist