Repository navigation
Conversation
Synchronized narration audio locators now carry `physicalPage` in their locations on Android and iOS: the label of the latest pageList entry at or before the narrated text. Apps can show the current printed page and step to the previous or next page during playback. Locations.physicalPage now reads that location, with the old `physicalPage=` fragment as fallback. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…e location The getter reads the physicalPage location first, but the setter only wrote a physicalPage= fragment, so a new value was hidden by an existing location and null could not clear it. The setter now sets or removes the location and drops any legacy fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page only advanced when a narration item was itself a page-list anchor, so a page break without a narration cue left the following text on the previous page, or on none. When the overlays are loaded, Android and iOS now read the element ids of every narrated XHTML file that holds a page-list entry and give each item the latest page break before it in document order. Files that cannot be read keep the exact-match behaviour. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Opening a publication with a page list read the XHTML of every narrated file that held a page break, even when every page break had a narration cue and the cues already gave the page. Only files with a page break that no narration item points at are now read, so publications whose page breaks are all cued open without extra XHTML reads. This follows ADR 0001, which reads XHTML only where cues cannot resolve the answer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add an integration test that seeks to cues around the page-3 break in the Sync Narration and Guided Navigation preview fixtures and checks the physicalPage of the timebased locator: none before the first page break, "3" at the break, and "3" carried into the next resource. goToLocator first publishes the requested locator, so the test waits for the player's own locator, which has a time fragment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emmiemmy
marked this pull request as ready for review
December 2, 2026 11:15
This branch has not been deployed
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.
Summary
Apps could not show the current printed page while a book is read aloud. The page was only worked out by the reader view, from what is visible on screen, so the audio locators never had it. Without a visible reader view there was no page at all.
On Android and iOS, every narrated sentence now gets the page it is on: the latest page break in the
pageListat or before it. The audio locator includes it asphysicalPage. This works for both Sync Narration and Guided Navigation.Locations.physicalPagealso returned null during normal reading on Android and iOS. The native side sends the page as aphysicalPagelocation, but the getter only read aphysicalPage=fragment, which the native side never sends.Change
withPhysicalPagesgives each narrated sentence its page. The audio locator adds it asphysicalPage, next totocHref.XhtmlIdTreeand checking which page break comes before the text. This is the same approach ADR 0001 uses for ToC entries without a cue. Only files that contain such a page break are read.Locations.physicalPagereads thephysicalPagelocation, and still reads the old fragment for older saved locators.copyWithPhysicalPageNumberwrites to and clears the same location.Review notes
Verification
PhysicalPageTest(11 tests) and all unit tests (162) pass.ktlintandcompileDebugKotlinare clean.PhysicalPageTests(8 tests, one of them loads a small book with a page break without a cue) and all RunnerTests (115) pass.flutter build ios --no-codesignpasses.flutter_readium_platform_interface249,flutter_readium52), includinglocations_physical_page_test.dart.bin/format,bin/analyzeandbin/check_channel_parityare clean.narration locators carry the physical page, using38533_overlay_previewand38533_guided_navigation_preview. Passes on an Android emulator and an iOS simulator.Timebased playbackgroup on the iOS simulator: 21 passed, 1 skipped.physicalPagechanged correctly in all four cases.Not covered
38533_overlay_previewwithout the page-break cue could be added toreadium-test-resourcesif you want one.🤖 Generated with Claude Code