Skip to content

fix: prevent DIVINA scroll RTL loading stalls#635

Merged
everpcpc merged 1 commit intomainfrom
codex/fix-divina-scroll-rtl-loading
Mar 9, 2026
Merged

fix: prevent DIVINA scroll RTL loading stalls#635
everpcpc merged 1 commit intomainfrom
codex/fix-divina-scroll-rtl-loading

Conversation

@everpcpc
Copy link
Copy Markdown
Owner

@everpcpc everpcpc commented Mar 9, 2026

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.viewItems in 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

  • Add PageViewMode.displayOrderedItems(_:) for scroll-mode display projection
  • Update iOS and macOS ScrollPageView to use canonical collection coordinates and display-order snapshots
  • Keep DivinaReaderView identity handling intact while avoiding repeated content-key recomputation in the subtree
  • Preserve the follow-up invalidation and image-cache behavior, and remove the temporary investigation-only debug logging

Validation

  • make format
  • make build-macos
  • make build-ios
  • make build-tvos

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.
@everpcpc everpcpc merged commit 1edc10a into main Mar 9, 2026
3 checks passed
@everpcpc everpcpc deleted the codex/fix-divina-scroll-rtl-loading branch March 9, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant