ts-toolkit
ts-toolkit copied to clipboard
Helpers for publication start and end
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 theend(right LTR); - marking the publication as read
- Moving to the next publication in a series
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.
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.
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 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. 🙏
Yes that's the one, let's talk about it later then 👍