Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add the scroll progressions in the EPUB viewport#620

Merged
mickael-menu merged 1 commit intodevelopfrom
viewport-scroll
Jun 20, 2025
Merged

Add the scroll progressions in the EPUB viewport#620
mickael-menu merged 1 commit intodevelopfrom
viewport-scroll

Conversation

Copy link
Member

mickael-menu commented Jun 20, 2025

  • Add the scroll progression ranges for each visible reading order resource in the EPUB's viewport object.
  • Fixed viewport positions with FXL EPUB.

mickael-menu temporarily deployed to LCP June 20, 2025 16:07 -- with GitHub Actions Inactive
mickael-menu temporarily deployed to LCP June 20, 2025 16:07 -- with GitHub Actions Inactive
mickael-menu requested a review from Copilot June 20, 2025 16:07
Copilot AI reviewed Jun 20, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates how scroll progression ranges are handled in the EPUB viewport and fixes viewport positions for FXL EPUBs. Key changes include updating progression methods to return ClosedRange rather than Range, modifying associated variable types and computations in EPUBReflowableSpreadView.swift, and enhancing EPUBNavigatorViewController.swift by mapping progression values for visible reading order resources.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
Sources/Navigator/EPUB/EPUBSpreadView.swift Changed progression() to return a ClosedRange with a default value of 0 ... 1
Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift Updated progression variable types and adjusted progression computation using ClosedRange
Sources/Navigator/EPUB/EPUBNavigatorViewController.swift Added a progressions property using a reduce on readingOrderIndices and updated locator calculations
Comments suppressed due to low confidence (3)

Sources/Navigator/EPUB/EPUBSpreadView.swift:347

  • The default progression value has been changed from an empty range (0 ..< 0) to a full range (0 ... 1). Update the documentation for progression(in:) to clarify that this default is used when a resource does not override the method.
0 ... 1

Sources/Navigator/EPUB/EPUBNavigatorViewController.swift:647

  • [nitpick] The variable 'link' is re-declared in this diff. Consider renaming it (e.g., 'firstLink') to avoid potential confusion with any earlier usage of a similar variable name.
let link = readingOrder[firstIndex]

Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift:343

  • [nitpick] Verify that the use of a ClosedRange for progression correctly represents the intended behavior, ensuring that firstProgression and lastProgression are always in the correct order to prevent unintentional overlapping or inversion of the progression range.
progression = firstProgression ... lastProgression

mickael-menu merged commit 1c89282 into develop Jun 20, 2025
5 checks passed
mickael-menu deleted the viewport-scroll branch June 20, 2025 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot Copilot left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants