-
Notifications
You must be signed in to change notification settings - Fork 164
Deprecate the Presentation Hints from the RWPM models #631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 removes the deprecated Presentation hints from the Readium Web Publication Manifest (RWPM) models and replaces them with a new layout
property on Metadata
and Properties
.
- Remove all references to
Presentation
-based hints and related tests. - Introduce a shared
Layout
enum and addlayout
toMetadata
andProperties
. - Update EPUB parser and navigator code to use
metadata.layout
instead of per-link presentation hints.
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
Tests/StreamerTests/Parser/EPUB/Services/EPUBPositionsServiceTests.swift | Removed mixed-layout test and updated factory signature to accept layout instead of presentation . |
Tests/StreamerTests/Parser/EPUB/OPFParserTests.swift | Dropped presentation properties assertions; expect empty Properties for deprecated hints. |
Tests/StreamerTests/Parser/EPUB/EPUBMetadataParserTests.swift | Replaced otherMetadata checks with assertions on layout ; removed deprecated presentation metadata tests. |
Tests/StreamerTests/Parser/EPUB/EPUBManifestParserTests.swift | Updated metadata parsing tests to assert layout values only. |
Tests/SharedTests/Publication/PropertiesTests.swift | Added tests for new Properties.page property. |
Tests/SharedTests/Publication/Extensions/* | Removed all Presentation-related tests under Presentation extensions. |
Sources/Streamer/Parser/EPUB/Services/EPUBPositionsService.swift | Switched from per-link presentation.layout to global layout . |
Sources/Streamer/Parser/EPUB/OPFParser.swift | Removed parsing of presentation hints (layout , orientation , overflow , spread ) from item properties. |
Sources/Streamer/Parser/EPUB/OPFMeta.swift | Limited .rendition meta keys to only layout . |
Sources/Streamer/Parser/EPUB/Extensions/Layout+EPUB.swift | Added Layout initializer for EPUB rendition values. |
Sources/Streamer/Parser/EPUB/EPUBMetadataParser.swift | Replaced presentation logic with layout() function; removed Presentation JSON. |
Sources/Shared/Publication/ReadingProgression.swift | Deprecated the leadingPage property. |
Sources/Shared/Publication/Properties.swift | Introduced Properties.page to replace Presentation.Page . |
Sources/Shared/Publication/Layout.swift | Added new Layout enum with reflowable , fixed , and scrolled cases. |
Sources/Shared/Publication/Metadata.swift | Added optional layout field to Metadata and updated JSON parsing/encoding. |
Sources/Shared/Publication/Extensions/Presentation/* | Marked all Presentation extensions and properties as unavailable. |
Sources/Navigator/Preferences/Types.swift | Updated ReadingProgression to include startingPage ; removed Presentation.Spread mapping. |
Sources/Navigator/EPUB/Preferences/EPUBSettings.swift | Removed fallback on deprecated metadata.presentation.spread . |
Sources/Navigator/EPUB/Preferences/EPUBPreferencesEditor.swift | Switched from metadata.presentation.layout to metadata.layout . |
Sources/Navigator/EPUB/EPUBSpread.swift | Removed layout from EPUBSpread init; use global metadata.layout and Properties.page . |
Sources/Navigator/EPUB/EPUBNavigatorViewModel.swift | Updated layout check to publication.metadata.layout . |
Sources/Navigator/EPUB/EPUBNavigatorViewController.swift | Swapped spread.layout for publication.metadata.layout . |
CHANGELOG.md | Documented deprecation of Presentation hints in RWPM profiles. |
Comments suppressed due to low confidence (3)
Sources/Shared/Publication/ReadingProgression.swift:21
- We deprecated
leadingPage
without providing a replacement in the sharedReadingProgression
API. Consider adding a newstartingPage
property onReadingProgression
(aliasing the old behavior) to guide consumers toward the updated terminology.
@available(*, unavailable)
Sources/Streamer/Parser/EPUB/OPFParser.swift:236
- [nitpick] The removal of all rendition properties parsing (layout, orientation, overflow, spread) in
parseStringProperties
may break EPUB-specific extensibility. If per-resource layout overrides are still desired, consider parsinglayout
into aProperties
field or documenting this intentional removal.
var page: Properties.Page?
Sources/Streamer/Parser/EPUB/Services/EPUBPositionsService.swift:91
- [nitpick] The
.scrolled
layout is currently treated the same as.reflowable
. If you intend to support distinct behavior for continuous scroll, consider handling.scrolled
explicitly or documenting that it maps to the reflowable strategy.
switch layout {
f2e14bf
to
79dcdbc
Compare
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.
Looks good overall, just nitpicking on two properties where the comment is not completely accurate.
Deprecated
Shared