Skip to content

feat: add CBZ and DiViNa comic support#155

Open
ddfreiling wants to merge 22 commits into
mainfrom
claude/modest-babbage-ffb425
Open

feat: add CBZ and DiViNa comic support#155
ddfreiling wants to merge 22 commits into
mainfrom
claude/modest-babbage-ffb425

Conversation

@ddfreiling

Copy link
Copy Markdown
Member

No description provided.

ddfreiling and others added 9 commits June 19, 2026 09:13
Adds comic reading on iOS via the existing EPUB fixed-layout navigator
(upstream deprecated CBZNavigatorViewController in favour of it), plus the
shared Dart plumbing so the public API treats comics consistently.

CBZ (raw image archive):
- Publication.conformsToReadiumDivina helper (CBZ parses to the DiViNa profile).
- B&W comic mode now covers the FXL page image (body > img) in addition to
  Nota's bespoke EPUB comic DOM; EPUBReaderView propagates the CSS vars into
  the FXL blob-iframe via window.spread.eval for divina publications.

DiViNa narrated comic (Guided Navigation):
- containsGuidedNavigation / isAudioBook now recognise DiViNa, not only EPUB,
  so a DiViNa carrying a guided-navigation document drives the existing
  media-overlay audio pipeline (audioref/textref -> audio reading order +
  page-synced text locators). Panel zoom is intentionally out of scope here;
  imgref #xywh regions are carried in the asset for that follow-up.
- bin/make_comic_divina.py converts the EPUB+MO comic webpub into a native
  DiViNa + guided-navigation package.

Example app (smoke-test target): .cbz/.divina added to the asset allowlist,
"Comic" book-format label, and the generated test assets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- sample_comic.cbz: synthetic 3-page CBZ for the raw-image path.
- 50272-nota-comics.divina: the Nota narrated comic re-expressed as a DiViNa +
  Guided Navigation package, generated from 50272-nota-comics.webpub via
  bin/make_comic_divina.py (see example/assets/pubs/README.md).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- bin/download_sample_fixtures: downloads fat sample fixtures (Pepper &
  Carrot ep01 as CBZ, CC-BY 4.0) that are excluded from the repo via
  .gitignore. Packages individual low-res JPEGs from peppercarrot.com
  into a CBZ with ComicInfo.xml. Idempotent; --force to re-download.
- sample_comic.cbz: regenerated with realistic 600×900 page dimensions
  and ComicInfo.xml (title, series, author). The previous 100×150 size
  caused exaggerated letterboxing in the FXL spread.
- toc.page.dart: replace "[NO_TITLE]" fallback with basenameWithoutExtension
  of the href so image-only publications (CBZ, DiViNa) show readable
  page identifiers instead of a literal placeholder.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
was not implemented upstream (but is in swift-toolkit)
@ddfreiling ddfreiling marked this pull request as ready for review June 23, 2026 13:36
@ddfreiling ddfreiling requested a review from m-abs June 23, 2026 13:36
ddfreiling and others added 4 commits June 23, 2026 16:02
…-ffb425

* origin/main:
  chore: reduce claude.md size
  chore: make vscode recognize web test files
  chore: allow Claude Code to launch example web app via Claude_preview
  fix(iOS): observed crash issue when starting MO playback
ts-toolkit ships no DiViNa/image navigator — WebPubNavigator builds an
HTML iframe per resource and throws on non-HTML media types. Fill the
gap with a minimal FlutterDivinaNavigator that pages through reading-order
images one <img> at a time.

- New FlutterDivinaNavigator: image pager with RTL awareness, position
  list, locator emission, and destroy() cleanup. Mirrors the
  VisualNavigatorLike interface so ReadiumReader drives it uniformly.
- ReadiumReader: route conformsToDivina publications to the new navigator
  through a _comicNav / _visualNav indirection; all navigation methods
  (goTo, goRight/Left/Forward/Backward, goToProgression) work for DiViNa.
- Example: add test-divina fixture (manifest + images + guided-navigation.json)
  and register it in webManifestList.json.

Guided Navigation (audio sync) is not yet wired — render-only for now;
the fixture includes a guided-navigation.json for the follow-up commit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wire guided-navigation audio support for the web DiViNa navigator,
matching the page-level playback that native (iOS/Android) supports.

- openPublication: detect guided-navigation.json at DiViNa open time
  using the existing detectGuidedNavigation() helper.
- audioEnable: when _comicNav is active (DiViNa), branch to a
  page-only sync callback instead of the EPUB iframe path.
- _syncDivinaToMediaOverlayLocator: new helper that navigates the
  FlutterDivinaNavigator to the page identified by textLocator.href
  on each audio cue advance. Panel-level xywh fragments are present
  in the locator but not acted on (no zoom implemented yet).
- stop(): clear _lastMediaOverlayLocatorKey unconditionally for any
  guided-nav publication; restrict applyDecorations to EPUB (_nav) only.

The full guided-navigation audio pipeline reuses the existing
initializeGuidedNavigationNavigator / FlutterAudioNavigator path —
only the visual-sync callback is different.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@m-abs m-abs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@m-abs

m-abs commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Not sure about the failing test?

Carry Guided Navigation imgref xywh panel regions through sync narration locators so comic navigators can frame narration cues.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add pure comic transform helpers, gesture-driven zoom and pan in the DiViNa navigator, and audio cue auto-pan support for panel regions.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add the Flutter API and web bridge for toggling DiViNa comic auto-pan, surface narration sync state, and show a re-sync control in the example app.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
supports client-controlled re-sync, when taking manual control of panning
includes tests and better improved teardown
* main:
  ci: use temurin distribution for java builds
  ci(web): build the web reader bundle (/readiumReader.js) in CI
  ci: build webview helpers in all native pipelines via shared action
  ci(ios): align build-ios DerivedData cache key with integration test
  fix(ios): build webview helper assets in CI; guard missing-asset crash
  ci(ios): collect crash logs from failed integration tests
  ci(ios): use expanded reporter
  fix(ios): ttsEnable was not awaited properly
  ci: ensure gradle wrapper is created before tests
  ci: fix missing dependencies in test workflow
  chore: more branch safety mechanisms
  chore: update changelog
  chore: update documentation
  chore: update CI test workflow
  chore: add tests for fontSize issue
  fix!: EPUBPreferences.fontSize is now a double ratio, not a percentage int
  chore: resolve bin/install issue with older npm versions
  chore(claude): instructions on finising worktree branches
  fix: EpubColumnCount should serialize correctly for all platforms
  chore: minor cleanup of build scripts
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