Add continuous vertical scrolling for reflowable EPUBs#766
Add continuous vertical scrolling for reflowable EPUBs#766shiyukk wants to merge 1 commit intoreadium:developfrom
Conversation
Render reflowable EPUB spreads in a single vertical container when `EPUBPreferences.scroll` is enabled, so readers can scroll through all chapters continuously without swiping horizontally between spreads.
|
Thanks @shiyukk for tackling this — continuous vertical scrolling is a highly requested feature. I’ve been working on a separate branch to implement the same feature, so I have some insights into the trade-offs involved. I have a few architectural concerns and specific issues I’d like to discuss. Main concern:
|
|
Thanks for the detailed feedback! You're right that extending PaginationView with a scroll direction is cleaner than a separate class. Happy to collaborate on your branch — I can help with testing or pick up specific pieces. Let me know if you'd like me to close this PR or keep it open as reference. |
|
Thank you for your contribution @shiyukk. Please don't hesitate to reach out via Discord or GitHub issues before starting a new PR. We can discuss the details and confirm if the feature is already planned or in progress before you begin your work. I haven't looked at the code yet, but I agree with @grighakobian's analysis. I did try your code and it looks very promising. I have one UX caveat: we should not be able to scroll through the whole publication while it's loading all the intermediate resources. If a next (or previous) resource is currently loading, the user should not be able to scroll past it, until it is loaded. Also, I think the changes in the Test App are out-of-scope for this PR. |
|
Thanks for trying it out and the feedback! Good point on the scroll-past-loading issue, I hadn't thought about that. I think this could be handled by clamping contentSize to only include loaded resources (or the one currently loading), then expanding it as each resource finishes. Sorry for not reaching out first, will definitely check in on Discord or open an issue before starting next time. Appreciate the guidance! |
Summary
Add true continuous vertical scrolling for reflowable EPUBs when
EPUBPreferences.scrollis enabled.Instead of keeping each spread in the horizontal pagination container, scroll mode now stacks spreads vertically in a dedicated continuous container, so readers can move through chapters without horizontal page turns.
Scope
applies only to reflowable EPUBs in scroll mode.
keeps existing paginated behavior unchanged when scroll mode is disabled.
does not affect fixed-layout EPUBs.
Notes
This introduces
ContinuousPaginationViewand updates reflowable spread navigation, height measurement, and location/viewport calculation to work in a multi-spread continuous flow.