Skip to content

Conversation

@mickael-menu
Copy link
Member

Summary

  • Adds offsetFirstPage preference to control whether the first page of a fixed-layout EPUB is displayed alone (centered) or alongside the second page when spreads are enabled.
    • When true, first page displays alone; when false, pairs with second page; when nil, uses publication metadata
  • Significant refactoring of the EPUBSpread models.

Changelog

Added

Navigator

  • Added offsetFirstPage preference for fixed-layout EPUBs to control whether the first page is displayed alone or alongside the second page when spreads are enabled.

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 adds a new offsetFirstPage preference for fixed-layout EPUBs that controls whether the first page is displayed alone (centered) or alongside the second page when spreads are enabled. The implementation includes a significant refactoring of the EPUBSpread models from a struct-based design to a protocol-based enum design with distinct single and double spread types.

Changes:

  • Added offsetFirstPage preference (nullable Bool) for EPUB fixed-layout and PDF navigators
  • Refactored EPUBSpread from a struct to an enum with EPUBSingleSpread and EPUBDoubleSpread types implementing a common EPUBSpreadProtocol
  • Updated UI to support nullable boolean preference picker with "Auto", "Yes", and "No" options

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Sources/Navigator/EPUB/EPUBSpread.swift Major refactoring to protocol-based enum design; added offsetFirstPage parameter to spread creation logic
Sources/Navigator/EPUB/Preferences/EPUBPreferences.swift Added offsetFirstPage: Bool? property to preferences model
Sources/Navigator/EPUB/Preferences/EPUBPreferencesEditor.swift Added preference editor for offsetFirstPage with appropriate effectiveness conditions
Sources/Navigator/EPUB/Preferences/EPUBSettings.swift Added offsetFirstPage: Bool? to settings and initialization
Sources/Navigator/EPUB/EPUBSpreadView.swift Updated to use refactored spread model with spread.first.link
Sources/Navigator/EPUB/EPUBReflowableSpreadView.swift Updated to use spread.first.link instead of direct reading order access
Sources/Navigator/EPUB/EPUBFixedSpreadView.swift Updated to pass readingProgression to JSON generation
Sources/Navigator/EPUB/EPUBNavigatorViewModel.swift Added offsetFirstPage property accessor
Sources/Navigator/EPUB/EPUBNavigatorViewController.swift Removed force parameter from reload logic; passes offsetFirstPage to spread creation
Sources/Navigator/PDF/Preferences/PDFPreferences.swift Updated documentation for offsetFirstPage
Sources/Navigator/PDF/Preferences/PDFPreferencesEditor.swift Updated documentation for offsetFirstPage
TestApp/Sources/Reader/Common/Preferences/UserPreferences.swift Added nullableOffsetFirstPage parameter and nullableBoolPickerRow UI component
CHANGELOG.md Documented the new feature

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mickael-menu mickael-menu merged commit 8327f0b into develop Jan 19, 2026
12 checks passed
@mickael-menu mickael-menu deleted the fxl-offsetFirstPage branch January 19, 2026 17:26
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.

2 participants