Skip to content

Add continuous vertical scrolling for reflowable EPUBs#766

Open
shiyukk wants to merge 1 commit intoreadium:developfrom
shiyukk:feature/vertical-scroll
Open

Add continuous vertical scrolling for reflowable EPUBs#766
shiyukk wants to merge 1 commit intoreadium:developfrom
shiyukk:feature/vertical-scroll

Conversation

@shiyukk
Copy link
Copy Markdown

@shiyukk shiyukk commented Apr 2, 2026

Summary

Add true continuous vertical scrolling for reflowable EPUBs when EPUBPreferences.scroll is 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 ContinuousPaginationView and updates reflowable spread navigation, height measurement, and location/viewport calculation to work in a multi-spread continuous flow.

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.
@grighakobian
Copy link
Copy Markdown
Contributor

grighakobian commented Apr 6, 2026

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: ContinuousPaginationView duplicates PaginationView

The new ContinuousPaginationView (519 lines) reimplements most of the infrastructure that already exists in PaginationView, including loadedViews, loadingIndexQueue, loadNextPage(), scheduleLoadPages, flushViews, and page lifecycle management. The only significant differences are the layout axis and the absence of paging snap.

To support vertical continuous scrolling, we can extend PaginationView by adding a ScrollDirection enum (.horizontal / .vertical) and branching on it in layout, preloading, and scroll tracking. This approach avoids maintaining two parallel view hierarchies with duplicated logic and ensures that future bug fixes are centralized.

I recommend refactoring to extend PaginationView instead of introducing a separate class. Collaborating on this feature would be beneficial, as I’ve been working on it since last week and have a working solution that extends PaginationView without creating a separate view for vertical continuous scrolling. I plan to submit a pull request by the end of the week, as I’ll be off until Wednesday.

@shiyukk
Copy link
Copy Markdown
Author

shiyukk commented Apr 6, 2026

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants