Repository navigation
Description
Summary
Reported via tester feedback (R): images/diagrams inside EPUB content are not rendered by the iOS reader. Confirmed as a real gap, distinct from the DRM issue (#351).
This is the deferred "rendering fidelity" half of #108, which was explicitly scoped out at the time ("fixing it properly means rendering an AttributedString ... instead of plain text ... it should land separately from the blank-page fix") but never re-filed as its own issue.
Platform status
- Android: not affected.
EpubNavigatorFragment(Readium's WebView-based navigator, seefeature/reader/src/main/kotlin/xyz/libravault/feature/reader/epub/EpubReaderScreen.kt) renders full HTML/CSS including<img>tags natively. - iOS: real gap. The EPUB/PDF reading path has no image-rendering capability at all:
BookContentProvider.chapters(for:)(ios/LibraVaultApp/LibraVault/LibraVault/Sources/Models/BookContentProvider.swift:38-53) producesBookChapter { title, text }— no image field. Contrast with Markdown content, which loads amarkdownImages: [String: Data]dictionary eagerly (ReaderView.loadMarkdownImages, lines 302-316).EPUBParser.strippingTags(EPUBParser.swift:251-282) regex-strips all tags, including<img>, with no src/alt capture.ReaderView.paginatedContent/scrollingContent(ReaderView.swift:509-613) render EPUB/PDF chapters as a single flat SwiftUIText(currentPageText)— there is no image view in this code path, only in the separateMarkdownReaderContent.
Proposed fix
Move iOS's EPUB (and PDF/text) reading path off flat Text(String) onto a content model that preserves inline images — either AttributedString/NSTextAttachment inline images, or a styled block model similar to what MarkdownReaderContent already does. This requires:
- Extending
BookChapter/content extraction to capture image references + asset bytes (similar tomarkdownAssetData). - Extending
TextPaginatorto account for image block heights when paginating. - New rendering code in
ReaderView's EPUB/PDF content path.
This is meaningfully larger than a hotfix — feature work, not a quick patch. Should be scoped/estimated before a dev agent picks it up (recommend status:needs-info → human scoping pass, or a design note, before flipping to status:ready-for-dev).
Severity
Medium — books with pure prose are unaffected, but any EPUB with meaningful figures/diagrams (textbooks, illustrated non-fiction, comics) is degraded to missing content on iOS, with no fallback/placeholder indicating an image was dropped.
Related: #108 (closed; blank-page half fixed, "rendering fidelity" half deferred here).
Activity
github-actions commentedon Aug 20, 2026
Triage: confirmed as a real, reproducible gap — verified in the code, not just the report.
BookContentProvider.chapters(for:)/BookChapter(Sources/Models/BookContentProvider.swift) carry only{ title, text }, no image data.EPUBParser.strippingTags(EPUBParser.swift:251-282) regex-strips all tags including<img>, with no src/alt capture — confirmed by reading the current regex pipeline.ReaderView's EPUB/PDF content path renders a single flatText(currentPageText); onlyMarkdownReaderContenthas an image-loading path (loadMarkdownImages), and that's a separate content model entirely.EpubNavigatorFragmentrenders<img>natively) — this is iOS-only.Not proceeding to implementation. This isn't a case of unclear repro — it's that the fix has at least two materially different, defensible architectures (AttributedString/NSTextAttachment inline images vs. a styled block model mirroring
MarkdownReaderContent), and picking one commits the codebase to a direction that should have human input rather than an autonomous choice. It also touches the content model, the paginator, and the renderer together, which is feature-sized work, not a scoped hotfix. The issue author already flagged this and recommended a human scoping pass beforestatus:ready-for-dev— agreed.Applying
status:needs-infoper dev-agent triage criteria (ambiguous scope where two reasonable implementations would look very different). No PR opened.libravault-xyz commentedon Aug 20, 2026
Decision: Option B (styled block model, mirroring
MarkdownReaderContent) — chosen over AttributedString/NSTextAttachment. Rationale: proven placeholder/alt-text UX already shipped inMarkdownBlockView, no dependency on the HTML importer that caused #108's blank-page bug, and a cleaner shared architecture across formats — traded off against needing genuinely new block-aware pagination (nothing paginates a block model in this codebase today;MarkdownReaderContentis scroll-only).Requested for TestFlight build 39.
Split into 5 sub-issues (linked above), sequential due to shared-file dependencies:
PDF is explicitly out of scope —
PDFParser/PDFKitalready renders real pages with images; only EPUB has the gap despite this issue's title.#356 is unblocked and going to dev-agent now. I'll flip each subsequent issue to
status:ready-for-devas its blocker merges, and step in myself on anything dev-agent needs-infos given the build 39 deadline.feat(ios): parse EPUB XHTML into a MarkdownBlock model (#362)
feat(ios): add block-aware paginator for EPUB's block model (#366)
libravault-xyz commentedon Aug 20, 2026
All 5 sub-issues merged — closing. Final chain: #356→PR #362, #357→PR #364, #359→PR #366, #361→PR #367, #360→PR #369 (two QA rounds; round 1 caught a real bookmark-locator regression from #369's branch predating #367, fixed properly by wiring in #367's
EPUBLocatorrather than the ad-hoc replacement it originally shipped with).EPUB now renders inline images/diagrams in both paginated and scrolling modes, backed by a shared block model with Markdown. PDF was out of scope throughout — PDFKit already renders images natively.
Follow-up filed as a process fix, not tracked under this issue: #381 (dev-agent staleness-check + no-self-authorized-regressions rule, prompted directly by the #369 collision).
Non-blocking cleanup noted by review, not yet filed as an issue:
TextPaginator.swift/TextPaginatorTests.swiftare now dead code (EPUB was their only consumer).