Commit Graph

249 Commits

Author SHA1 Message Date
schroda
187693ce5a Properly handle not skipping duplicate chapters
The filtered chapter list of the reader state always incorrectly filtered out duplicated chapters even while the setting was disabled
2025-02-05 20:05:36 +01:00
schroda
a32c88a549 Reset "ReaderChapterViewer" min width/height on "ReadingMode" change 2025-02-05 15:48:55 +01:00
schroda
5e8b5545a6 Add comments to functions 2025-02-05 15:26:40 +01:00
schroda
34ebcc4f4c Improve naming of functions and variables 2025-02-05 15:17:48 +01:00
schroda
155f58b92d Consider only relevant element intersection for open prev/next chapter
In the "vertical mode" intersection changes for the left or right side of the element do not matter.
Same for "horizontal mode" the other way around.

If not handled accordingly, it would cause unwanted chapter changes.
2025-02-05 15:17:46 +01:00
schroda
9b58a94f98 Fix image preload amount for current chapter
For the current chapter the "pages to render" always include the current page
2025-02-05 01:27:42 +01:00
schroda
19f2d99345 Center "ReaderChapterViewers"
The viewers can have different sizes which caused theme to not be properly centered.

E.g. for the "vertical mode" in case "chapter 1" is greater in width than "chapter 2", the pages of "chapter 2" were not correctly centered due to the "viewers" having different widths.
2025-02-05 00:34:44 +01:00
schroda
636f48107f Prevent "ReaderChapterViewer" from overlapping each other
Seems like not all browsers handle

width/height: 100%
min-width/min-height: fit-content

correctly.
the "min" setting just never applies and the size is stuck at 100%.
2025-02-04 23:11:34 +01:00
schroda
2ec42d962a Remove context usage from ReaderPage
In case many chapters are rendered, even just the HOC wrapper component re-render due to the context change increases the render time.

Thus, getting rid of these HOC wrapper re-renders by moving the context usage up to the ReaderViewer decreases the render time.
2025-02-03 17:17:35 +01:00
schroda
b01b23b069 Remove context usage from ReaderChapterViewer
In case many chapters are rendered, even just the HOC wrapper component re-render due to the context change increases the render time.

Thus, getting rid of these HOC wrapper re-renders by moving the context usage up to the ReaderViewer decreases the render time.
2025-02-03 17:17:35 +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
45b4874348 Remove unnecessary keys 2025-02-03 17:17:35 +01:00
schroda
c79ccf3523 Improve memoization of "ReaderTransitionPage"
- use chapter properties instead of chapter object
- only pass "handleBack" in case the transition page is for the first or last chapter
2025-02-03 17:17:35 +01:00
schroda
91e8b70d35 Rename "initialChapter" to "chapterForDuplicatesHandling" 2025-02-03 17:17:35 +01:00
schroda
8ddb259c82 Prevent tooltip on disabled button warning 2025-02-02 00:54:03 +01:00
schroda
2c4a17b32f Ensure to always have one page in reader
Current logic requires at least one page.
In case a chapter did not have any page a TypeError occured
2025-01-30 00:19:05 +01:00
schroda
25e3fc7808 Load images with cors allowed
Without allowing cors it is e.g. not possible to extract colors from an image
2025-01-26 04:20:59 +01:00
schroda
b7fc1ae6ff Extract theme context logic into its own provider 2025-01-25 19:22:24 +01:00
schroda
b67c9c4e44 Fix reader chapter transition page positioning in double page mode
Regression 649a17c2ae
2025-01-23 20:36:19 +01:00
schroda
e5b9767daa Fix page width with static nav bar
Regression 7fad96dab7
2025-01-23 14:10:13 +01:00
schroda
c47889c2e3 Extract reader pages context default values 2025-01-21 19:19:31 +01:00
schroda
649a17c2ae Move "ReaderTransitionPage" to "ReaderViewer" 2025-01-21 19:19:27 +01:00
schroda
db7aad58ec Convert reader image placeholder styling to vw/vh 2025-01-21 19:19:25 +01:00
schroda
7fad96dab7 Convert reader image styling to vw/vh
Preparation for infinite scroll, since there will be a wrapper which fits its content in width and height, thus, percentage based dimension won't work anymore
2025-01-21 19:19:22 +01:00
schroda
da600bcdec Extract reader pages wrapper styling 2025-01-21 19:19:21 +01:00
schroda
ca1c95cdfe Show chapter transition warning for mobile progress bar open chapter buttons 2025-01-21 19:19:20 +01:00
schroda
b7cb245abc Rename "getImageWidthStyling" to "getReaderImageStyling" 2025-01-18 23:13:56 +01:00
schroda
7f649296b9 Extract logic from "Reader" into hooks 2025-01-18 22:41:54 +01:00
schroda
19f83d5237 Extract hooks from utils file 2025-01-18 22:07:59 +01:00
schroda
8e1d9b3106 Change reader non-static nav bar icon 2025-01-17 01:38:19 +01:00
schroda
d95396ecb0 Consider reader nav bar width and scrollbars for auto scrollbar position 2025-01-17 01:26:09 +01:00
schroda
c227570b93 Fix closing desktop nav bar after change to none static 2025-01-17 01:26:08 +01:00
schroda
9ac1009e22 Properly update reader desktop nav bar download button
Did not update according to download updates due to not subscribing to the fragment changes

Regression 257c0c8e10
2025-01-17 01:26:07 +01:00
schroda
9255386b1c Properly check if chapter should be deleted after reading it
In case the current chapter should get deleted after reading it, it only worked in case it was already marked as read due to checking the read status from the chapter itself instead of the chapter update patch input
2025-01-16 14:19:18 +01:00
schroda
92f64ef009 Handle single page chapters for download ahead 2025-01-16 14:07:21 +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
97dba923b4 Improve "chapter list" render performance
affected components:
- ChapterList
- ReaderChapterList
2025-01-12 20:28:22 +01:00
schroda
257c0c8e10 Move download status subscription to "ChapterCard"
Only re-render chapters whose download status has changed instead of the whole list everytime a download status change was received
2025-01-12 20:28:18 +01:00
schroda
57f73636a0 Read chapter download status from cache
Instead of getting the whole download status, which contains all queued/active downloads, the download status should be read from the cache for only the required chapters
2025-01-12 14:09:10 +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
7901961821 Add "auto" progress bar position
Automatically choose the progress bar position based on the available space.
Previously it was only possible to automatically switch from a horizontal to a vertical position but not the other way around
2025-01-11 03:09:10 +01:00
schroda
757cf599d6 Enable mouse drag scrolling for all reading modes 2025-01-10 02:07:24 +01:00
schroda
afc3a23ae0 Always scroll to start of page on page change
By the time the scroll area got scrolled to the start of the visible pages, the previous/next page wasn't yet shown and thus, the scrollable area wasn't updated yet.
Thus, in case the scrollable area grew in width due to the page change, the start never got scrolled into view due to triggering the logic too early.
2025-01-10 02:03:31 +01:00
schroda
a423d11442 Prevent reader pages from getting cut off on small screens
In case the pages were larger in width then the screen, they got cut off and were not fully viewable.
2025-01-09 21:41:38 +01:00
schroda
288fee590d Extract "apply reader width" check into function 2025-01-09 02:11:44 +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
8ae8cfa140 Fix tsc issues 2025-01-04 20:59:18 +01:00
schroda
afeb0f9aca Correctly check if chapter exists
The wrong chapter list was used.
"chapters" is the filtered list of chapters, which e.g. doesn't contain duplicated chapters.
This caused the "chapter source order" to potentially be higher than the total chapters of the manga.

The end result of this was that the fetched state of the pages wasn't properly detected causing errors due to rendering the reader before it was in the correct state
2025-01-04 15:58:33 +01:00