Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination Controls Jump to Chapter Beginnings #21

Open
bluefirepatrick opened this issue Nov 6, 2024 · 2 comments
Open

Pagination Controls Jump to Chapter Beginnings #21

bluefirepatrick opened this issue Nov 6, 2024 · 2 comments

Comments

@bluefirepatrick
Copy link
Member

Environments Tested:
MacOS - Safari and Chrome

Steps to Reproduce:
Build/run the scroll-paginated branch
Choose Moby Dick
Use Right Arrow/Page Forward button to go to Chapter 3
Switch to Scrollable via the Actions Menu
Scroll to end of page and Choose Next
Switch back to Paginated via the Actions Menu
Choose Left Arrow/Go Backwards

Expected Result:
Left arrow would take you to the last page of Chapter 3.

Actual Result:
Left arrow takes you to the start of Chapter 3 and subsequent paging is stuck in 'next resource' mode.

Notes:
At one point I saw a runtime error (included) but I do not have steps to reproduce that error yet.
Screenshot 2024-11-06 at 9 32 09 AM

@JayPanoz
Copy link
Contributor

JayPanoz commented Nov 7, 2024

Thanks for logging these issues as it will help keep track of side effects and serve as a reminder to double-check if they are solved or need more work after migrating.

So there are two side-effects here, from these missing pieces in TS-toolkit:

  1. Preferences API;
  2. Scroll event.

At first sight it should explain the entire issue, probably also the error message, although I’ll take a look as I already fixed others similar to this one.

To clarify what’s happening:

  1. progression is not tracked nor saved in scroll at the moment so it will always be 0 as it’s saved on positionChanged when scroll is applied using internal methods, which explains it goes back at the start of the resource when changing the layout option;
  2. at the moment settings are applied after the frame has loaded or when changing the setting, but they don’t trigger a recalc for the scrollWidth. There are already issues with auto-columns as navigator may occasionally skip the last “page” of a chapter when it has a single column. That should hopefully be fixed with a Preference API since it should take care of that. Obviously this issue is new with ReadiumCSS 2 since it removes the responsive layout that was implemented in CSS, and not by applying custom properties dynamically.

@HadrienGardeur What is your opinion on scroll event? Do you want me to temporarily implement this in Playground or add it directly into ts-toolkit, or wait as Preferences API may have an impact? If it’s added into ts-toolkit I’m not sure it will not create conflicts in the DM Reader, which is why I’m not sure what’s the best option is.

@HadrienGardeur
Copy link
Member

Sorry that I forgot to chime in on that matter.

I strongly believe that this is something that the ts-toolkit should return. Given the nature of scroll events, we might need to look into throttling/debouncing to keep things in check, but we should get an event that reading apps can used to store progression (among other things).

I'm not so sure that the Preferences API has much of an impact on that since the ts-toolkit should be able to know whether we're currently paginated/scrolling, even without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Draft
Development

No branches or pull requests

3 participants