Skip to content

Native: comic panel box (xywh) is ignored #235

Description

@ddfreiling

Summary

Guided-navigation cues for comics can carry a panel box, e.g. imgref: "image0001.jpg#xywh=pixel:44,113,757,226". Web reads it and pans/zooms to the panel while the audio plays. iOS and Android ignore it, so they turn the page but always show the whole page.

Where it stands today

Platform Page turn on cue Pan/zoom to panel
Web comicRegionFlutterDivinaNavigator.panToRegion
iOS ❌ no xywh parsing anywhere
Android ✅ (after #234) ❌ no xywh parsing anywhere

Related defect on iOS

iOS passes the raw imgref through as the item's text reference:

// GuidedNavigationDocument.swift
if let audio = obj.audioref, let text = obj.textref ?? obj.imgref {

FlutterMediaOverlayItem then splits on # and publishes the fragment as a CSS selector:

locator.locations.otherLocations["cssSelector"] = .string("#\(frag!)")

For a panel cue that yields cssSelector: "#xywh=pixel:44,113,757,226" — not a DOM id, and not a valid selector. It reaches Dart on every comic cue. Android avoids this (#234 drops the fragment); iOS still needs it handled, ideally by parsing the box instead of discarding it.

Suggested work

  1. Parse #xywh=pixel:x,y,w,h in the iOS and Android guided-navigation item models.
  2. Carry the box on the cue locator, the way web puts comicRegion in otherLocations.
  3. Pan/zoom the native comic navigators to the box, with the same auto-pan and manual-override gating web uses.
  4. Stop publishing the box as a cssSelector on iOS.

Web reference: flutter_readium/web/src/mediaoverlay/syncNarration.ts (parseImgField, textLocatorForItem) and _syncDivinaToMediaOverlayLocator in ReadiumReader.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestupstream-issueThis issue is identified as being caused by upstream Readium toolkits

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions