Repository navigation
Conversation
- resolve current page from viewport edges so the last page of a chapter is always registered (counter and percent stuck at 18/19 / 97%) - re-report current page when scrolling settles, item positions freeze at the scroll edges so no scroll event fires there - save reading state from viewport geometry instead of stale touch coordinates captured on tap/long press - clamp computed percent to 1f to avoid float overshoot breaking isCompleted checks
sang765
force-pushed
the
fix/webtoon-last-page-progress
branch
from
November 3, 2026 09:30
ff99eec to
f14eb3e
Compare
dragonx943
approved these changes
Nov 6, 2026
Member
|
Migrated to #168 |
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.
Summary
Fixes webtoon mode where the page counter and reading progress get stuck at
18/19 · 97%even after scrolling to the last page of the newest chapter.Root causes
ReaderViewModel.onCurrentPageChangedresolves the current page as the center of the visible range(first + last) / 2. When the last page is short (credits pages are common), the previous page's window is still partially visible at the bottom, so the center is always the second-to-last page. Additionally, the scroll dispatcher only emits events when item positions change — at max scroll positions freeze, so no further events can ever mark the last page. (Chapters whose last page fills the viewport worked, which is why the bug looked inconsistent.)getCurrentState()probed the page under the last tap/long-press coordinates (stickydownY), so exiting the reader saved an older page: progress regressed in details screen and reopening started at18/19again.computePercentcould produce values slightly above1fwhen the chapter count doesn't divide evenly, failingisCompleted/isValidchecks and breaking the 100% display.Changes
WebtoonReaderFragment: resolve the current page from viewport geometry — last page at the bottom edge, first page at the top edge, center of visible range otherwise; probe state from the layout manager instead of stale touch coordinates; re-report the page onSCROLL_STATE_IDLE(catches flings landing exactly at max scroll).WebtoonRecyclerView: scroll dispatcher also fires when at-top/at-bottom state flips (fires immediately when the edge is reached mid-drag).ReaderViewModel: clampcomputePercentto1f.TapGridDispatcher/ReaderActivity: visibility reverted toprivatefor fields that no longer have external readers.Testing
19/19, percent100%