Repository navigation
refactor(epub): rebuild iOS page-curl mode on one web view per chapter - #1237
Merged
Merged
Conversation
- run one live EpubPageViewController per chapter plus preloaded boundary neighbors (at most 3 web views), replacing the 5-entry per-page controller cache, the pending/reserved controller bookkeeping with its 0.3s cleanup timer, and the backside-image LRU - UIPageViewController slots become dumb shells: a chapter-internal flip covers the front shell with a snapshot of the current page and migrates the live web view into a pre-sized target shell scrolled to the target page, so the curling leaf is a static image while the reveal and the committed page stay the same live view - cross-chapter flips keep the live leaf and reveal the preloaded neighbor chapter, rotating roles on commit - interactive turns commit or restore in didFinishAnimating, programmatic turns in their own setViewControllers completion; internal pan recognizers carry a target that cancels dataSource prefetches abandoned before the curl starts - tap zones, book-end refusal with onEndReached, RTL spine/semantic mapping, backside style, overlay labels, and progress recording behave as before
refreshNeighbors ran before commitLocation, so the coordinator's stale page index made a cross-chapter commit skip preloading the previous chapter (and could preload the wrong next chapter); the host's own sub-page index is already at the committed page.
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.
What
Rebuilds the iOS page-curl transition on the same single-web-view-per-chapter architecture the cover mode moved to in #1236, instead of one
WKWebViewper page.EpubPageViewControllerper chapter plus preloaded boundary neighbors (at most 3 web views), replacing the 5-entry per-page controller cache, thependingControllers/reservedControllersbookkeeping with its 0.3s cleanup timer, and the backside-image LRU.UIPageViewControllerslots become dumb shells (CurlPageShellViewController): a chapter-internal flip covers the front shell with a snapshot of the current page and migrates the live web view into a pre-sized target shell scrolled to the target page. The curling leaf is a static image, the mirrored back uses the existingPageCurlBacksideViewController, and the reveal plus the committed page are the same live view.didFinishAnimating; programmatic turns commit in their ownsetViewControllerscompletion. The internal pan recognizers carry a target that cancels dataSource prefetches abandoned before a curl starts, so a dropped gesture can never wedge the turn state.onEndReached, RTL spine/semantic mapping, backside style, overlay labels, and progress recording behave as before.Why
The per-page model held up to 5 whole-chapter DOMs in separate web content processes, and every in-chapter page turn re-injected CSS and re-ran pagination for a chapter already laid out next door. One web view per chapter removes both costs and deletes the compensating bookkeeping around
UIPageViewController's opaque retention.Validation
make buildpasses on all platforms.onEndReachedpath (same unchanged boundary check as book start).Part of #1234