Repository navigation
Add an experimental timeline for audio, EPUB and PDF publications - #925
Merged
Merged
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Audio configuration validation, timeline interval coverage, and URL handling have unresolved correctness defects.
4 open issues
What changed in this PR
Adds experimental publication timelines for chapter lookup, navigation, and boundaries across audiobooks, EPUB, and PDF.
Changes:
- Introduces timeline models, format-specific resolvers, and cached services.
- Integrates timelines into parsers and adds configurable audiobook fallbacks.
- Adds tests and updates documentation.
| File | Description |
|---|---|
| Tests/TestSupport/Timeline+Outline.swift | Adds readable timeline assertions. |
| Tests/StreamerTests/Parser/Readium/ReadiumWebPubParserTests.swift | Tests service selection and fallbacks. |
| Tests/StreamerTests/Parser/PDF/PDFParserTests.swift | Tests PDF timeline integration. |
| Tests/StreamerTests/Parser/EPUB/EPUBParserTests.swift | Tests EPUB timeline integration. |
| Tests/StreamerTests/Parser/Audio/AudioParserTests.swift | Tests audio timelines and configuration. |
| Tests/StreamerTests/Parser/Audio/AudioManifestBuilderTests.swift | Tests optional title-based contents. |
| Tests/SharedTests/Toolkit/Selectors/TemporalSelectorTests.swift | Updates experimental imports. |
| Tests/SharedTests/Toolkit/Selectors/PDFSelectorTests.swift | Tests PDF selector parsing. |
| Tests/SharedTests/Toolkit/AsyncThrowingMemoizerTests.swift | Tests caching and retries. |
| Tests/SharedTests/Publication/Services/Timeline/WebTimelineServiceTests.swift | Tests web timeline behavior. |
| Tests/SharedTests/Publication/Services/Timeline/TimelineTests.swift | Tests timeline construction and queries. |
| Tests/SharedTests/Publication/Services/Timeline/TimelineLayoutTests.swift | Tests resource lengths and boundaries. |
| Tests/SharedTests/Publication/Services/Timeline/PDFTimelineServiceTests.swift | Tests PDF services and failures. |
| Tests/SharedTests/Publication/Services/Timeline/PDFTimelinePositionResolverTests.swift | Tests page resolution. |
| Tests/SharedTests/Publication/Services/Timeline/AudioTimelineServiceTests.swift | Tests audio services and caching. |
| Tests/SharedTests/Publication/Services/Timeline/AudioTimelinePositionResolverTests.swift | Tests temporal position resolution. |
| Tests/SharedTests/Publication/Extensions/Audio/Locator+AudioTests.swift | Updates experimental imports. |
| Tests/SharedTests/Extensions.swift | Updates selector imports. |
| Tests/NavigatorTests/Audio/AudioNavigatorTests.swift | Updates selector imports. |
| Sources/Streamer/Parser/Readium/ReadiumWebPubParser.swift | Registers timelines and configuration. |
| Sources/Streamer/Parser/PDF/PDFParser.swift | Registers PDF timelines. |
| Sources/Streamer/Parser/EPUB/SMIL/SMILParser.swift | Imports experimental selectors. |
| Sources/Streamer/Parser/EPUB/EPUBParser.swift | Registers EPUB timelines. |
| Sources/Streamer/Parser/Audio/Services/AudioLocatorService.swift | Imports experimental selectors. |
| Sources/Streamer/Parser/Audio/AudioParser.swift | Adds configuration and timeline registration. |
| Sources/Streamer/Parser/Audio/AudioManifestBuilder.swift | Makes title-based contents optional. |
| Sources/Shared/Toolkit/Selectors/TemporalSelector.swift | Marks temporal selectors experimental. |
| Sources/Shared/Toolkit/Selectors/PDFSelector.swift | Adds PDF fragment selectors. |
| Sources/Shared/Toolkit/AsyncThrowingMemoizer.swift | Caches successful asynchronous results. |
| Sources/Shared/Publication/Services/Timeline/WebTimelineService.swift | Builds web timelines. |
| Sources/Shared/Publication/Services/Timeline/WebTimelinePositionResolver.swift | Resolves web resource positions. |
| Sources/Shared/Publication/Services/Timeline/TimelineService.swift | Exposes publication timeline services. |
| Sources/Shared/Publication/Services/Timeline/TimelineSegment.swift | Defines labeled intervals. |
| Sources/Shared/Publication/Services/Timeline/TimelinePositionResolver.swift | Defines the resolution interface. |
| Sources/Shared/Publication/Services/Timeline/TimelinePosition.swift | Defines positions and offsets. |
| Sources/Shared/Publication/Services/Timeline/TimelineLayout.swift | Calculates resource boundaries and progression. |
| Sources/Shared/Publication/Services/Timeline/TimelineItem.swift | Defines hierarchical timeline entries. |
| Sources/Shared/Publication/Services/Timeline/Timeline.swift | Implements timeline construction and queries. |
| Sources/Shared/Publication/Services/Timeline/PDFTimelineService.swift | Builds page-based timelines. |
| Sources/Shared/Publication/Services/Timeline/PDFTimelinePositionResolver.swift | Resolves PDF locations. |
| Sources/Shared/Publication/Services/Timeline/AudioTimelineService.swift | Builds audio timelines and fallbacks. |
| Sources/Shared/Publication/Services/Timeline/AudioTimelinePositionResolver.swift | Resolves audio locations. |
| Sources/Shared/Publication/Extensions/Audio/Locator+Audio.swift | Marks temporal access experimental. |
| Sources/Navigator/Audiobook/AudioNavigator.swift | Imports experimental selectors. |
| docs/Guides/Navigator/Audiobook.md | Updates parser configuration examples. |
| CHANGELOG.md | Documents timelines and configuration options. |
| .claude/skills/write-tests/SKILL.md | Documents structured test arguments. |
Review effort: Balanced
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.

Added
Shared
Publication.timeline()API. ATimelinelays out the table of contents on the reading order, to answer questions such as "which chapter am I in?", "what's the next chapter?" or "how long is this chapter?". It is available for audiobooks, EPUB (limited support) and PDF.