-
Notifications
You must be signed in to change notification settings - Fork 203
Add offsetFirstPage preference for fixed-layout EPUBs#697
Merged
mickael-menu merged 3 commits intodevelopfrom Jan 19, 2026
Merged
Add offsetFirstPage preference for fixed-layout EPUBs#697mickael-menu merged 3 commits intodevelopfrom
offsetFirstPage preference for fixed-layout EPUBs#697mickael-menu merged 3 commits intodevelopfrom
Conversation
Member
Summary
- Adds
offsetFirstPagepreference 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; whenfalse, pairs with second page; whennil, uses publication metadata
- When
- Significant refactoring of the
EPUBSpreadmodels.
Changelog
Added
Navigator
- Added
offsetFirstPagepreference for fixed-layout EPUBs to control whether the first page is displayed alone or alongside the second page when spreads are enabled.
There was a problem hiding this 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
offsetFirstPagepreference (nullable Bool) for EPUB fixed-layout and PDF navigators - Refactored
EPUBSpreadfrom a struct to an enum withEPUBSingleSpreadandEPUBDoubleSpreadtypes implementing a commonEPUBSpreadProtocol - 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.
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.