Conversation
跨章節後若下一個 spine 項目沒有文字內容(例如純標題頁/圖片頁,如 xxxt.xhtml),getChapterText() 量到空字串,原本邏輯重試一次就直接放棄 朗讀,導致跟三個合法停止條件(手動停止、睡眠計時、全書結尾)無關的 情況下朗讀就中斷。改成持續往後翻頁跳過空白頁,直到找到真正有文字的 頁面才開始念。 同時在 tts.ts 的 speakChunk 與 useTTSReading.ts 的跨章節決策點加上 __DEV__ 診斷 log,方便之後同類問題排查。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 29 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe reader now recovers from stalled chapter navigation, skips empty chapters during TTS continuation, and records development-only diagnostics for chapter advancement and speech playback. ChangesTTS navigation and playback
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Sequence Diagram(s)sequenceDiagram
participant useTTSReading
participant advanceToNextChapter
participant readerWeb
participant speakChunk
useTTSReading->>advanceToNextChapter: Request chapter advancement
advanceToNextChapter->>readerWeb: Relocate to next chapter
readerWeb-->>useTTSReading: Return chapter text or navigation result
useTTSReading->>speakChunk: Speak first non-empty chapter text
speakChunk-->>useTTSReading: Report completion or playback error
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mobile/hooks/reader/useTTSReading.ts`:
- Around line 83-97: Update the readNextAndContinue retry loop so the
destination reached by the twentieth navigation is checked for readable text
before stopping. At hop === 19, perform the final relocation without another
navigation, then request and process that destination’s text, while preserving
the existing atEndRef handling and retry limit.
In `@mobile/reader-web/index.ts`:
- Line 141: Reset consecutiveStuckNext alongside the other per-book relocation
state at the start of loadBook, ensuring each book begins with a zero recovery
counter and does not inherit stalled-relocation state from the previous book.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 35071d07-71f8-47a8-b184-3f54a2e3e4ed
⛔ Files ignored due to path filters (1)
mobile/lib/readerHtml.generated.tsis excluded by!**/*.generated.*
📒 Files selected for processing (3)
mobile/hooks/reader/useTTSReading.tsmobile/lib/tts.tsmobile/reader-web/index.ts
- useTTSReading.readNextAndContinue 最後一次翻頁(hop===19)後迴圈直接結束, 未檢查該次翻頁真正到達的頁面是否有文字,導致該頁若剛好有文字會被略過而誤判放棄。 - reader-web loadBook 重置換書狀態時漏了 consecutiveStuckNext,導致新書會沿用 上一本書的卡頁計數,可能提早誤觸發「連續卡頁跳章」邏輯。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
跨章節後若下一個 spine 項目沒有文字內容(例如純標題頁/圖片頁,如
xxxt.xhtml),getChapterText() 量到空字串,原本邏輯重試一次就直接放棄
朗讀,導致跟三個合法停止條件(手動停止、睡眠計時、全書結尾)無關的
情況下朗讀就中斷。改成持續往後翻頁跳過空白頁,直到找到真正有文字的
頁面才開始念。
同時在 tts.ts 的 speakChunk 與 useTTSReading.ts 的跨章節決策點加上 DEV 診斷 log,方便之後同類問題排查。
Summary by CodeRabbit