Skip to content

Add an experimental timeline for audio, EPUB and PDF publications - #925

Merged
mickael-menu merged 9 commits into
developfrom
feature/audio-timeline
Oct 19, 2026
Merged

mickael-menu merged 9 commits into
developfrom
feature/audio-timeline

Conversation

@mickael-menu

Copy link
Copy Markdown
Member

Added

Shared

  • New experimental Publication.timeline() API. A Timeline lays 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

@mickael-menu
mickael-menu merged commit 948f53e into develop Oct 19, 2026
5 checks passed
@mickael-menu
mickael-menu deleted the feature/audio-timeline branch October 19, 2026 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants