fix(reader): stop iOS page-turn animation stutter (#4768) (#4772)

* fix(reader): stop iOS page-turn animation stutter (#4768)

iOS users saw occasional page-turn animation stutter that was not present
on earlier 0.11.x builds. It traces to foliate-js commit c1c7315 (first
shipped in 0.11.4): the large-section rafAnimateScroll fallback and the
removal of persistent compositor-layer hints, both added to fix a ~1s
Blink freeze on Android Chromium at high DPR.

Apple WebKit composites those layers fine, so on iOS (notably 120Hz
ProMotion devices) the changes only cost smoothness: large-section turns
animate scroll on the main thread, and every turn promotes a layer
on-demand instead of using a persistent one.

Opt the iOS renderer into foliate-js's new gpu-composite path, which
restores persistent compositor layers and skips the main-thread
rafAnimateScroll fallback. Other platforms keep the Android freeze fix.
Bumps the foliate-js submodule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore(deps): repin foliate-js to merged gpu-composite commit (#4768)

readest/foliate-js#39 squash-merged to a new commit on main. Move the
submodule pin off the now-orphaned PR branch commit to the merged main
commit. No content change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-06-25 10:46:16 +08:00
committed by GitHub
parent 44a6900da0
commit 0c7ffa9799
2 changed files with 9 additions and 1 deletions
@@ -687,6 +687,14 @@ const FoliateViewer: React.FC<{
} else {
view.renderer.removeAttribute('animated');
}
// iOS WebKit composites large/persistent page layers without the Android
// high-DPR Blink freeze, so opt this renderer into the GPU-accelerated
// page-turn path (persistent compositor layers + no main-thread
// rafAnimateScroll fallback) to keep 120Hz ProMotion turns smooth
// (readest#4768).
if (appService?.isIOSApp) {
view.renderer.setAttribute('gpu-composite', '');
}
if (viewSettings.disableSwipe) {
view.renderer.setAttribute('no-swipe', '');
} else {