fix(paginator): emit periodic relocates while a continuous scroll never pauses - #72
Merged
Merged
Conversation
…er pauses In scrolled mode the relocate that reports reading position sits behind a 250ms trailing debounce. A scroll that never pauses, such as the Auto Scroll reading mode stepping the container every frame, resets the timer forever, so reading progress only updates once the scrolling stops (readest#5635). Track the current unbroken run of scroll events and force the relocate at most once per second while it lasts. The debounced call still reports the final position and ends the run. Finger drags are skipped for the same reason preloading skips them: the measurement drops frames mid-swipe, and the release settles through the debounce anyway (readest#4785). Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
In scrolled mode the relocate that reports reading position sits behind a 250ms trailing debounce. A scroll that never pauses, such as the Auto Scroll reading mode stepping the container every frame, resets the timer forever, so reading progress (percentage and time remaining) only updates once the scrolling stops (readest/readest#5635, item 2).
This tracks the current unbroken run of scroll events and forces the relocate at most once per
SCROLL_RELOCATE_MAX_WAIT(1s) while the run lasts. The debounced call still reports the final position and ends the run.Finger drags are skipped for the same reason preloading skips them: the visible-range measurement drops frames mid-swipe, and the release settles through the trailing debounce anyway (readest/readest#4785).
#isAnimatingand#stabilizing/#justAnchoredguards are shared with the debounced path via the extractedscrolledScrollRelocate.Covered by a new regression test in readest: a 2.5s continuous scroll burst must emit at least two 'scroll' relocates while still in progress (was zero).
🤖 Generated with Claude Code