ts-toolkit icon indicating copy to clipboard operation
ts-toolkit copied to clipboard

Helpers for publication start and end

Open JayPanoz opened this issue 1 year ago • 1 comments

It could help implementers if Navigator could return whether a publication is at the start or the end in a reliable manner.

Although it’s possible to implement different strategies at the app level, we know it’s also difficult to do it for end since progression is never 100%, a position may be spread on 2 pages, etc. This is why the additional information Navigator gets privately could help determine these 2 states more reliably.

Use cases include:

  • disabling navigation arrows while at start (left in LTR) or the end (right LTR);
  • marking the publication as read
  • Moving to the next publication in a series

JayPanoz avatar Oct 09 '24 05:10 JayPanoz

This is also something that we've been requested on mobile toolkits. I thought of adding information about the column index + column count of the current resource in the "moved" event.

Caveat: Many books actually end much before the end of the reading order. Here landmarks would be more useful.

mickael-menu avatar Oct 09 '24 10:10 mickael-menu

Adding resource start/end to this issue since we already have two practical cases where it would be useful to display scroll affordances on web.

And they actually have some kind of relationship since in the simplest form, start of the publication is start of the first resource, while end of the publication is the end of the last resource.

JayPanoz avatar Jun 30 '25 10:06 JayPanoz

By the way I recently added this in the Swift toolkit which can be used to calculate this info: https://github.com/readium/swift-toolkit/blob/1c89282c2220841e37cce1a481dee91dd7c54f57/Sources/Navigator/EPUB/EPUBNavigatorViewController.swift#L135-L145

mickael-menu avatar Jun 30 '25 10:06 mickael-menu

@mickael-menu is this the PR where you mentioned me and Henry? Apologies I didn’t have time to take a closer look at that time. But if that indeed is, I’d probably like to discuss this during the Web call this afternoon so that both toolkits are on the same page – pun unintended. 🙏

JayPanoz avatar Jun 30 '25 11:06 JayPanoz

Yes that's the one, let's talk about it later then 👍

mickael-menu avatar Jun 30 '25 12:06 mickael-menu