fix: prevent DIVINA scroll RTL loading stalls#635
Merged
Conversation
Keep native scroll collections in canonical left-to-right coordinates and project RTL through display order instead of container semantic mirroring. This prevents DIVINA scroll mode from resolving visible items against mirrored collection coordinates, which could leave the current page stuck in loading after opening reader sheets or toggling controls. Also removes the temporary debug instrumentation added during investigation while preserving the structural RTL fix.
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.
Problem
DIVINA scroll mode could leave the visible page stuck in loading when opening the reader, toggling controls, or opening and dismissing settings, TOC, and page-jump sheets in RTL mode.
The issue was not an image cache miss. The native scroll host was mixing logical page order with collection-view semantic mirroring, so visible cells could resolve to the mirrored item instead of the committed reader position.
Approach
Keep the native scroll collections in canonical left-to-right coordinates and model RTL through an explicit display-order projection.
This keeps
ReaderViewModel.viewItemsin logical order, while the scroll host uses a reversed display snapshot for RTL mode. Initial positioning, navigation-target handling, and visible-item commits now all run against the same coordinate space instead of relying on container semantic mirroring.Scope
PageViewMode.displayOrderedItems(_:)for scroll-mode display projectionScrollPageViewto use canonical collection coordinates and display-order snapshotsDivinaReaderViewidentity handling intact while avoiding repeated content-key recomputation in the subtreeValidation
make formatmake build-macosmake build-iosmake build-tvos