Commit Graph

70 Commits

Author SHA1 Message Date
schroda
e28c603112 Streamline tap zone click handling 2025-02-18 02:06:12 +01:00
schroda
d3c6acbbfb Fix going to previous/next page from first/last 2025-02-18 02:01:16 +01:00
schroda
10ad7ce5d7 Fix marking chapter as read for single page chapters in paged pagers
Regression from 174d850093
2025-02-17 01:12:56 +01:00
schroda
cc7eca08d7 Handle closing transition pages in paged pagers for single page chapters
In case a chapter only has a single page and the previous/next transition page was visible, it was not possible to go back to the chapters page, since it just opened the previous/next chapter instead
2025-02-17 01:12:55 +01:00
schroda
174d850093 Preload previous/next chapter in reader 2025-02-10 22:40:49 +01:00
schroda
cae52fd782 Add "blend mode" to "custom color filter" 2025-02-08 01:49:37 +01:00
schroda
4a9d2903b8 Add infinite scroll to reader 2025-02-03 17:17:35 +01:00
schroda
4789a74785 Add option to open specific chapter via "useOpenChapter" 2025-02-03 17:17:35 +01:00
schroda
91e8b70d35 Rename "initialChapter" to "chapterForDuplicatesHandling" 2025-02-03 17:17:35 +01:00
schroda
c227570b93 Fix closing desktop nav bar after change to none static 2025-01-17 01:26:08 +01:00
schroda
a96bc2c1da Delete chapter when read even if already marked as read
ReaderControls#useUpdateCurrentPageIndex:
On a page change the chapter update needs to be always queued since the deletion of downloaded chapters while reading logic is in the "ReaderService#updateChapter" function.
Thus, when the update is prevented here, this logic would never get triggered.

ReaderService#useUpdateChapter:
In case the read status or lastPageRead of a chapter did not change, the update was not triggered.
However, there might still be chapter downloads that need to be de deleted, which was never handled in such a case.
2025-01-16 13:22:13 +01:00
schroda
64e06b2966 Handle ".5" chapters as full chapter numbers for missing chapter detection
Chapter numbers can change from e.g. "1" to "2.1" and in that case missing chapters were detected.
However, with these weird chapter numbers it's not clear if a chapter is actually missing or not, thus, they should not cause a missing chapter warning
2025-01-11 13:58:46 +01:00
schroda
a51d81d267 Extract "MetadataReader" functions 2025-01-04 21:28:26 +01:00
schroda
3782091601 Remove metadata "applyMigration" option 2025-01-04 21:23:05 +01:00
schroda
f90e4597f8 Make mobile progress bar position changeable 2025-01-02 21:48:02 +01:00
schroda
2944252d91 Make chapter transition warnings optional 2025-01-01 17:24:36 +01:00
schroda
f3792edac0 Ignore visible transition pages on page change in continuous pager 2024-12-31 17:03:42 +01:00
schroda
886cc469bc Fix TypeError when reaching scroll end in continuous pager
When the end of the scrollable element is reached in the continuous reader, the last image is not visible anymore.
Thus, the "firstVisibleImageIndex" is invalid and gets incorrectly used for the "isEndReached" case which results in an TypeError when trying to use the actual page via the index
2024-12-31 16:54:21 +01:00
schroda
d6a3d02189 Fix page jumping when scrolling continuous pagers
Both hardcoded thresholds (MIN_VISIBLE_PX 0 or 1) break the "first visible image" detection in different kind of ways.

With 1 it always incorrectly jumps to the next page when resuming a chapter, since the page to resume will bet at 0px.

With 0 it fails to detect the correct first visible image when scrolling (automatically not via wheel or touch) to another page.
This happens when there is no gap between the pages because in this case the start of the current image and the end of the previous image are at the same coordinate.
Thus, the previous image is still incorrectly detected as visible since the end still aligns with the viewports start/end
2024-12-31 16:43:46 +01:00
schroda
a0df80f60a Fix opening previous/next page via user action
Regression 55dc9471d9
2024-12-31 04:24:47 +01:00
schroda
55dc9471d9 Hide chapter transition page in single/double pagers
Transition page got opened and never closed again due to not correctly detecting that a transition page is currently visible
2024-12-30 19:57:18 +01:00
schroda
f3962646e6 Hide "tap zone overlay" on user action 2024-12-30 16:50:54 +01:00
schroda
6bf3e297ef Open previous/next chapter at end of continuous pager via hotkey
For continuous pagers the chapter transition page is always visible regardless of the current "transitionPageMode".
However, this was not properly checked and thus, it wasn't considered to be visible and instead of opening the previous/next chapter, the transition page got set to be visible first and only with the second hotkey press did the chapter get opened
2024-12-30 14:12:11 +01:00
schroda
3185449816 Improve "MobileReaderProgressBar" progress bar click/drag handling
Convert clicks on the progress bar in such a way, that there is a "padding" around the page "dots".
Thus, e.g. even if the click was actually for page 1, if it is inside page 2 padding, it will behave like it was a click for page 2
2024-12-28 04:05:29 +01:00
schroda
e2075a651e Add "automatic scrolling" 2024-12-27 03:02:39 +01:00
schroda
6b0df5329b Move "useHandleProgressDragging" to "ReaderControls" 2024-12-27 02:51:38 +01:00
schroda
cfd5b78488 Fix unchangeable global reader settings
Regression 72809309e1
2024-12-26 02:47:37 +01:00
schroda
72809309e1 Always register reader hotkeys
The hotkeys were never registered e.g. while loading or in case an error occurred
2024-12-24 17:26:45 +01:00
schroda
f5642af219 Use HOC for reader context usage 2024-12-22 00:48:18 +01:00
schroda
570b831604 Extract context types 2024-12-20 21:42:54 +01:00
schroda
3949363474 Include actual error in snackbar 2024-12-20 17:24:40 +01:00
robo
85bb032d03 fix reader chapter transition warning chapters number (#846) 2024-12-20 13:05:36 +01:00
schroda
0771eabfcf Always open first/last page when closing chapter transition page
When e.g. enabling the "offset spread pages" setting the current page index was still the one of the secondary page, which then caused the first page to get skipped.
2024-12-17 02:07:08 +01:00
schroda
74f78e40d4 Remove custom profiles
Instead of "custom profiles" each "reading mode" acts as a profile and has its own settings
2024-12-16 15:50:28 +01:00
schroda
e95cc232a2 Improve reader chapter update on last page reached
In case "endReached" is force set to "true" the chapters last page index should always be set to prevent 2 chapter updates
 - 1. for second to last page, read true
 - 2. last page, read true

This only happens in "continuous pagers" which have to handle cases where the end of the last page is already visible while the last page itself is too small to ever get set as the "current page index"
2024-12-16 14:49:37 +01:00
schroda
b4c1cdee77 Handle chapter updates sync in reader
To be able to properly prevent unnecessary chapter updates, the ongoing updates have to finish, so that the apollo cache is update to date.

Otherwise, the update guard will always be false since the apollo caches chapter data is still from before the previous updates were triggered.
2024-12-16 14:49:37 +01:00
schroda
fcd44abccd Update chapters in reader only when data will change
In case the chapters already match the "patch" input, an update is not required.
2024-12-16 14:49:36 +01:00
schroda
33910cc89d Prevent opening previous/next chapter on page selection
In case the first/last page was opened and a specific page was selected, instead of opening the page, the previous/next chapter was opened due to incorrectly handling the page change as a previous/next page change
2024-12-13 02:32:36 +01:00
schroda
f69fbd71d2 Open previous chapter transition page in double page mode
For the double page mode the secondary page index gets used.
This was changed with 9a8655db2f, however, this occurrence was overlooked
2024-12-13 02:30:49 +01:00
schroda
aaf7fb7b30 Prevent hiding overlay on page change through overlay 2024-12-13 02:15:18 +01:00
schroda
66b3757b12 Handle missing reader keybinds in metadata
The current default value fallback logic for metadata just checks if a key is missing, or if it's value is undefined.
Since the keybinds are an object, a keybind that got newly added and wasn't saved to the metadata was never added with its default value to the object due to the metadata containing a "keybinds" key with an existing value
2024-12-12 23:45:42 +01:00
schroda
d00c930598 Fix "is read" detection in single/double page mode
In case the last page of a manga was immediately visible or the became visible after the "image spread state" change, the chapter never got marked as read
2024-12-12 13:21:48 +01:00
schroda
89b81de830 Handle ".5" chapters in chapter transition warning
".5" chapters would incorrectly trigger the missing chapter warning
2024-12-12 12:56:40 +01:00
schroda
7307a3350d Catch uncaught promise 2024-12-11 22:40:06 +01:00
schroda
6dd2c8e2ff Show chapter transition warning
- on scanlator change
- on skipped chapters
2024-12-11 22:38:04 +01:00
schroda
8ca0af8d02 Hide overlay on page/scroll change 2024-12-11 22:36:02 +01:00
schroda
cff0ed5ec3 Extract app routes into constant 2024-12-11 20:25:49 +01:00
schroda
8c4ff516c0 Rename "theme.tsx" to "ThemeCreator.ts" 2024-12-11 18:02:03 +01:00
schroda
b3e3d94bda Move "theme.tsx" to proper module 2024-12-11 13:57:24 +01:00
schroda
5cda9a3972 Reduce chapter update mutation requests 2024-12-10 02:12:38 +01:00