Commit Graph

335 Commits

Author SHA1 Message Date
schroda
963cd55b37 Allow auto scrolling with static reader overlay 2025-07-04 18:43:33 +02:00
schroda
da78ce3181 Add hotkeys to switch auto scroll direction
While auto scroll is active, the direction can be changed via the "scroll backward/forward" hotkeys
2025-07-04 18:43:32 +02:00
schroda
51975ea3cd Add setting to apply chapter list filters in reader 2025-07-01 00:37:29 +02:00
schroda
6bc21c5972 Fix reader nav bar "settings" button title 2025-06-25 01:22:43 +02:00
schroda
cb74984659 Fix constraining logic of stored client metadata
By the time the constraining function was called, the stored values were still of type string and were not converted to the correct type yet.
2025-06-25 00:38:01 +02:00
schroda
56f01efc1e Ensure stored client metadata values respect constraints 2025-06-24 22:45:40 +02:00
FedericoRossiIT
cd34001fc3 Feat: Add custom scroll amount (#966)
* Added slower scroll amount mousewheel like feel

* Added custom scroll amount slider

* Made changes as requested
2025-06-08 18:44:18 +02:00
schroda
61471ae214 Show missing chapter info in chapter list
Closes #836
2025-05-24 22:03:54 +02:00
schroda
4452a9fc5c Handle trackpad scrolling in continuous vertical pager
Trackpads fire "wheel" events as if they were a mouse.
This is a problem because trackpads can scroll horizontally without having "shift" pressed. In that case, the hook causes the horizontal scrolling on trackpads to break, since it just inverts it, as if it was a vertical scroll.

Fixes #951
2025-05-21 23:01:09 +02:00
schroda
18ddf46f17 Save appearance settings on server
- app theme
- theme mode
- pure black mode
- manga grid item width
2025-05-17 21:31:24 +02:00
schroda
86f1905c7c Cleanup ReaderControls#scroll 2025-05-10 01:58:54 +02:00
schroda
40abcd828f Keep previous/next transition page open on first/last chapter previous/next page tap-zone click
In case the transition pages are disabled and the first/last chapters previous/next transition page was visible, clicking the next/previous tap-zone caused the chapter to jump to the first page of the current chapter.

Regression f0f740f4af
2025-05-10 01:58:51 +02:00
schroda
afdaf1f429 Move chapter types and constants to corresponding files 2025-05-05 01:54:44 +02:00
schroda
18be295ef5 Rename manga and chapter constants 2025-05-05 01:46:11 +02:00
schroda
f0f740f4af Add option to disable transition pages
The previous/next transition page of the first/last chapter will still be shown to indicate that there is no previous/next chapter
2025-05-05 01:26:27 +02:00
schroda
eb23f74a40 Fix reader next chapter visibility detection 2025-05-05 00:54:41 +02:00
schroda
aacdbaaeef Introduce "useAppAction" hook 2025-05-04 23:36:46 +02:00
schroda
3ab70c4802 Introduce "useAppTitle" hook 2025-05-04 23:36:18 +02:00
schroda
b80006504e Move files into different folders 2025-05-03 12:16:48 +02:00
schroda
24a0cfb3b0 Use "mantine/hooks" 2025-05-02 18:37:03 +02:00
schroda
e982b7c417 Preserve scroll position during infinite scroll initial previous chapter render 2025-05-02 17:32:56 +02:00
schroda
d603c614ef Extract scroll preservation data collection 2025-05-02 17:32:56 +02:00
schroda
d606130846 Ignore trailing image resize for scroll preservation
Resizes of elements below the current scroll position do not cause a layout shift; thus, they can be ignored.

This was a problem when using tap zone click scrolling, because the scrolling was aborted by the scroll position preservation
2025-05-02 17:32:55 +02:00
schroda
36fa8dbe38 Improve scroll preservation on window resize
The previous logic just preserved the scroll position on any resize event regardless of if the resize (width or height change) caused the scroll position to get lost or not.

E.g., when the "page scale mode" respected only the width and the resize only changed the window height, it still preserved the scroll position, while the scroll position did not get lost.
2025-05-02 02:30:06 +02:00
schroda
ef3538d762 Cleanup "useReaderPreserveScrollPosition" 2025-04-28 00:52:02 +02:00
schroda
a1cdc785c1 Prevent scrolling while dragging on the reader progress bar
On e.g., iOS changing the current page via dragging the progress bar caused the reader to scroll, which made the progress dragging act weirdly
2025-04-27 01:05:25 +02:00
schroda
beda5096d1 Add option to disable "infinite chapter scroll" 2025-04-26 23:19:01 +02:00
schroda
f9930b94ca Fix page resume on reader chapter list selection of already visible chapter
In case the selected chapter was already visible, the page to resume did not get scrolled into view
2025-04-26 23:12:00 +02:00
schroda
37127893b4 Make reader settings dialog transparent on some changes
- width change
- custom filter change
2025-04-25 02:51:48 +02:00
schroda
c0ab5f93a1 Extract list card avatar 2025-04-25 01:17:54 +02:00
schroda
3f93549f34 Update to react v19 2025-04-18 21:45:00 +02:00
schroda
ecbc0e3be2 Support different languages for auto webtoon detection 2025-04-18 00:34:26 +02:00
schroda
e6a105c766 Fix increase/decrease of auto scroll speed
Hotkeys were switched and did the opposite of their intended action
2025-04-05 13:01:40 +02:00
schroda
d89fbf9cf5 Cleanup "useReaderPreserveScrollPosition" 2025-04-05 12:56:44 +02:00
schroda
da34c77f03 Only observe "ReaderChapterViewer" resize events for scroll position preservation
It's not necessary to observe all elements, since "ReaderChapterViewer" is the parent and thus increases/decreases in size in case its children change.
2025-04-05 12:50:14 +02:00
schroda
b37ff532f5 Fix reverted code after merge
For some reason github didn't show a merge conflict on the pr
2025-04-05 12:48:36 +02:00
Constantin Piber
4423dee14e Fix preserving scroll position on infinite scroll previous chapter load (#913)
When scrolling to the previous chapter, which has not been preloaded, the scroll position got lost due to the resulting layout shift

* Update scroll preserve by tracking cursor

* Clean up interface

* Observe just the wrappers instead of individual images

* Switch to `IntersectionObserver` for tracking active element

* Clean up adding of observations

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

---------

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
2025-04-05 12:45:52 +02:00
schroda
b3860e4351 Preserve current position on "reading direction" change 2025-04-05 01:06:59 +02:00
schroda
e1895b21e3 Use "ReaderChapterViewer" as "root" for "IntersectionObserver" for "infinite scroll"
Using the actual "document element" as the "intersection observer root" causes issues in case the available reader width is less than the viewport.
In these cases sometimes the previous/next chapter never loaded because the necessary intersection never fired.
2025-04-05 01:05:54 +02:00
schroda
0f49115b23 Keep rendered chapters on infinite scroll chapter change
The changes from 642708b8b3 didn't consider the case were the chapter change was triggered due to scrolling to the unloaded previous/next chapter with infinite scroll
2025-04-02 02:45:22 +02:00
schroda
642708b8b3 Immediately open previous/next chapter on reader nav bar button click
The logic didn't handle cases were the next/previous chapter wasn't loaded yet, which lead to the load happening in the background without any user feedback.
2025-04-02 02:27:01 +02:00
schroda
e3934545b0 Change "large" IconButtons to default size 2025-03-28 19:05:21 +01:00
schroda
7145c33fbb Preserve current page on reader width change only when necessary
The pages only change in size with specific "page scale modes".
Thus, if these modes are not active, the scroll position will not be lost.

There are different cases were even with these modes active, the scroll position won't get lost (e.g. "fit width" while no page is larger than the available width), but handling these would be too cumbersome.

Ideally the relative scroll position would be preserved, however, from testing a little that seems to not work too well
2025-03-27 19:49:53 +01:00
schroda
62bd4fdfb2 Require library entry removal confirmation in reader 2025-03-27 19:49:50 +01:00
schroda
72fb053971 Add "scroll amount" setting 2025-03-27 19:49:49 +01:00
schroda
b93c2d95e5 Add hotkey to close reader 2025-03-27 19:49:44 +01:00
schroda
6f8d5bb9dc Remove unnecessary styling II
Missed in 157a549cc7
2025-03-25 00:04:12 +01:00
schroda
157a549cc7 Remove unnecessary styling 2025-03-24 23:46:57 +01:00
Constantin Piber
541eeb0445 Reader preserve current page on window resize (#905)
* Reader: Reset bounds on window size change

19f2d993 introduced a `minWidth` to make sure sizes are consistent over
chapter changes (or when images load later), but when the window itself
changes, this makes the reader incorrectly sized

* Reader: Update size on navbar width change

This happens mostly when the bar is pinned; same effect as previous
commit

* Reader: Attempt to set the page on resize

It's not perfect, but not changing position at all seems impossible due
to how resizes are handled by the browser (since we adjust our content
to the window size)

* Simplify and abstract reader size reset

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

* fix: Reader page full width was not properly calculated for static navbar

Only relevant for Fit Content, this did not properly consider the navbar
when the user clamps the content to a custom width

* Refactor: Put reader min sizes to reader itself instead of chapter

This allows some logic simplification.
The `ResizeObserver` can needs to be on an element without restrictions;
previously, the observer would not see the chapter elements get smaller,
since the `min-width` prevented it from shrinking. By applying to the
outer element, we still preserve the centering (since `margin: auto` is
also applied here), but allow the chapter itself to be smaller.

* Reader: Only scroll in continuous reading modes

* Reader: clean up size tracking

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

* Fixup previous commit stupidness

* Reader: move `minWidth`/`minHeight` back to chapter wrapper

* Apply suggestions from code review

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

* Also revert `fullWidth` calculation

* Simplify `chapterViewerSize`

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

* Move size logic entirely to hook

---------

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
2025-03-24 23:45:06 +01:00
Constantin Piber
c9c1b8625a Reader preserve current page on reader mode change (#906)
* Reader: Re-scroll on reader mode change

* Simplify reading mode restore

https://github.com/Suwayomi/Suwayomi-WebUI/pull/906#discussion_r2009147119

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

* Move effect as per suggestion

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>

---------

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
2025-03-24 23:24:36 +01:00