Repository navigation
fix(ios,android): keep title for untitled ToC entries, align overlays - #379
Open
ddfreiling wants to merge 2 commits into
Open
ddfreiling wants to merge 2 commits into
ddfreiling wants to merge 2 commits into
Conversation
A ToC entry's title is optional in RWPM. The plugin assigned it to the locator unconditionally, so an untitled entry replaced the title that the toolkit had already set with nil/null. Keep the existing title in that case. tocHref handling is unchanged. Native counterpart of Notalib#368 and Notalib#376. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Media-overlay items had the same unconditional ToC-title overwrite as the locator paths. Android replaced the reading-order title with an empty string for an untitled ToC entry, and exposed "" instead of null on the text and audio locators. iOS never started from the reading-order title at all. Keep the existing item title when a ToC entry has none, emit null instead of "" on the Android locators, and seed iOS overlay items with the reading-order title as Android does. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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
On iOS and Android the plugin takes
title(andtocHref) for emitted locators from the matching ToC entry. A ToCLink.titleis optional in RWPM, but the plugin assigned it unconditionally, so an untitled entry replaced the title already set upstream with nil/null. The media-overlay (sync narration) code had the same overwrite, and the two platforms disagreed on the initial item title and on how "no title" is exposed.Native counterpart of #368 and #376 (web). Only affects ToC entries without a title.
Change
title = entry.title ?? existingon iOS (FlutterReadiumPlugin.swift,EPUBReaderView.swift,PDFReaderView.swift) and Android (ReadiumReader.kt: both EPUB paths and PDF). The AndroidtocHrefpath also no longer nulls the title when no ToC entry matches.tocHrefhandling is unchanged.FlutterMediaOverlay.swift,ReadiumExtensions.swift; AndroidReadiumExtensions.kt,FlutterMediaOverlay.kt).title: nullfor "no title" instead of""(FlutterMediaOverlayItem.syncTextLocatorandskipToAudioLocator), matching iOS.Review notes
skipToAudioLocatortitle; not changed.Verification
./gradlew :flutter_readium:compileDebugKotlin :flutter_readium:testDebugUnitTest(existing tests): pass.ktlinton the changed Kotlin files: the only finding isFlutterMediaOverlayItem.kt:215(audioStart?: 0.0), which is already onmain.flutter build ios --no-codesigninexample/: pass.bin/changelog check: pass.Not covered
ReadiumReadersingleton (needs an Android context and an opened publication) and there is no Swift test target. A regression test would need new scaffolding.