Skip to content

fix: preload EPUB pages and prioritize the latest slider seek - #14

Merged
Eoic merged 7 commits into
developmentfrom
fix/reader-loading-motion
Oct 29, 2026
Merged

Eoic merged 7 commits into
developmentfrom
fix/reader-loading-motion

Conversation

@Eoic

@Eoic Eoic commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Closes #13. Supports FR-3_1 and FR-3_2.

EPUB opening now uses the host loading builder through initial pagination, keeping its position, theme and background without the separate “Preparing pages…” indicator. Reading settings provide a compact Slide / None dropdown. Instant turns respect system reduced motion and preserve selection and saved positions.

Page turns now use a larger buffer and avoid waiting for unrelated preparation:

  • Prepare the visible spread first, then maintain five spreads ahead and retain measured pages for reversing direction.
  • Prepare neighboring spine items independently, including the previous item's tail within three spreads of its boundary. A blocked next item cannot prevent backward preparation.
  • Warm nearby illustrations five spreads ahead and three behind using Flutter's image cache.
  • Start exact counting after the current buffer is ready. Prepared turns do not wait for another page beyond the destination.
  • Update the viewport's extent before an immediate turn to a newly prepared page, so its displayed and persisted locations stay aligned.

Slider navigation uses the latest destination. New drags and releases invalidate queued intermediate seeks and cancel active EPUB seek waits. Layout checks cancellation at yields, reusable pages stay cached, and late results or errors cannot replace the latest location. Background snapshots cannot move the slider thumb while dragging. Ordinary page turns stay ordered. Already-running worker parsing may finish into the cache, and engines without cooperative cancellation finish their active operation before the latest queued seek.

Custom panels can reuse the reader header through ReaderPanelContext.buildHeader, so the client's Contents and Reading settings share title typography, spacing, close button and divider.

After initial preparation, safe-area insets retain the page background through chapter transitions and typography reflows. A new document load restores the host-colored opening background. A real EPUB regression with nonzero insets covers these transitions and failed before the correction.

Validation:

  • All 231 reader tests passed. Regressions cover five ready forward turns, reversing direction, blocked neighbors in either direction, and immediate navigation after opening. Buffering and early-position regressions failed before their respective fixes. New tests cover coalesced slider releases, stable drag previews, stale errors, cancelled EPUB reads/layout, and a real viewport showing and persisting only the latest destination.
  • Reader/example analysis, example tests and web build passed.
  • Browser smoke passed for rapid back-and-forth slider drags, EPUB/PDF navigation, responsive settings, motion controls and opposing app/reader themes. Desktop and phone dropdowns were visually inspected.
  • Integration and the exact Git pin are in fix: integrate reader preloading and saved animation controls client#103.

No migration or version bump. Cold seeks and uncached previous-section tails can still require yielding layout. Synthetic checks do not certify performance on every device or publisher file.

Copilot AI balanced review requested due to automatic review settings October 29, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T19:15:20.368104Z 95ea8ea PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 95ea8ea0a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Eoic Eoic changed the title fix: keep opening feedback consistent and allow instant page turns fix: improve reader loading, page buffering and motion controls Oct 29, 2026
@Eoic Eoic changed the title fix: improve reader loading, page buffering and motion controls fix: preload EPUB pages and prioritize the latest slider seek Oct 29, 2026
@Eoic
Eoic merged commit 48fc8ac into development Oct 29, 2026
4 checks passed
@Eoic
Eoic deleted the fix/reader-loading-motion branch October 29, 2026 21:51
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.

Improve reader loading, nearby-page buffering and motion controls

2 participants