Commit Graph
100 Commits
Author SHA1 Message Date
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 3d120429ac Only set chapter card icon button color in reader mode 2025-01-17 16:12:15 +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 7818fb450d Fix text color of active chapter in chapter list of reader 2025-01-17 01:26:06 +01:00
schroda 5391bc256d Add "ying & yang" theme 2025-01-17 01:26:05 +01:00
schroda f7b21b1d7f Update "tree frog green" theme 2025-01-17 01:26:04 +01:00
schroda c36a0f8d02 Update "orange juice" theme 2025-01-17 01:26:03 +01:00
schroda 0b9697ec29 Update "minty miracles" theme 2025-01-17 01:26:01 +01:00
schroda 7da4dc7d39 Update "mountain sunset" theme 2025-01-17 01:26:00 +01:00
schroda a161aa663c Update "rosegold" theme 2025-01-17 01:25:59 +01:00
schroda 254a8cb1a7 Update "lavender" theme 2025-01-17 01:25:58 +01:00
schroda a22a4bf546 Switch to "colorSchemes" from "palette" API in mui theme
"colorSchemes" is the preferred api starting from mui v6
2025-01-17 01:25:55 +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 22011d4d6d Support search by source id in library 2025-01-16 13:33:16 +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 ef08799fc0 Render filtered chapters in ChapterList
Regression 257c0c8e10
2025-01-16 12:25:24 +01:00
schroda 5683c07712 Prevent "migrate dialog" from closing
Due to the scrollbar disappearing the dimension of the manga grid items changed which caused them to get unmounted and re-rendered again.
This then caused the dialog to get closed since the dialog is rendered in the manga grid item component
2025-01-13 03:26:07 +01:00
schroda 898fc6614f Increase virtuoso grid viewport 2025-01-13 02:17:09 +01:00
schroda 74c61a5a29 Improve manga grid/list rendering 2025-01-13 01:29:40 +01:00
schroda 63a6cfcfb3 Add merge function for "DownloadStatus" "queue" field 2025-01-12 20:55:08 +01:00
schroda e25aa98365 Do not update "download status" on "download updates"
For large download queues this makes the app unusable.

At the moment this is not needed anyway and once it is, it needs to be improved and only be done in the "download queue" page since the queue is only use there
2025-01-12 20:47:16 +01:00
schroda 7ed345cf87 Render "manga track dialog" only when opened 2025-01-12 20:28:24 +01:00
schroda ba52e70dbb Improve "Updates" render performance 2025-01-12 20:28:23 +01:00
schroda 97dba923b4 Improve "chapter list" render performance
affected components:
- ChapterList
- ReaderChapterList
2025-01-12 20:28:22 +01:00
schroda e7c3c8609e Improve "DownloadQueue" render performance 2025-01-12 20:28:21 +01:00
schroda 10a77722cc Remove outdated "download types" from apollo cache 2025-01-12 20:28:20 +01:00
schroda 77973df0ff Show non downloading state while partially downloaded
The state wasn't shown in case the chapter was partially downloaded
2025-01-12 20:28:20 +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 f7b26767a3 Extract Updates chapter card 2025-01-12 15:02:33 +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 abc3908b1e Only commit metadata changes of applied migrations
One of the errors that were caused by this was that everytime a new migration was applied, keys of previous migrations got deleted
2025-01-11 16:00:16 +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 6c8df33a13 Delete outdated metadata after committing updated ones
In case the outdated metadata get successfully deleted and the updated metadata fail to commit, metadata gets lost, due to not being able to apply the migrations again since the outdated metadata have already been deleted
2025-01-11 03:24:15 +01:00
schroda 338fb96de3 Prevent possible TypeError 2025-01-11 03:14:41 +01:00
schroda 07aeb53fa1 Commit metadata value migrations 2025-01-11 03:12:48 +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 f032f971ac Fix position of download status in updates page 2025-01-10 17:26:41 +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 e4e38e74b3 Handle nav bar safe area top inset
The default nav bar icons were possibly slightly hidden under the top bar in case there was a "safe area top inset"
2025-01-09 23:03:29 +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 28eb18f88c Prevent custom scrollbar on iOS
While iOS does not support customizing the scrollbar, it seems there is a bug when the width and/or height gets set.

(see MediaQuery#getScrollbarSize) When inserting an empty div with forced scrollbars and calculating the scrollbar size, for some reason on iOS it has a scrollbar that affects the available size, which is not possible.
2025-01-09 00:46:25 +01:00
schroda 6bbaee6d8d Replace deprecated "apple-mobile-web-app-capable" meta tag 2025-01-09 00:28:19 +01:00
schroda 11765c021a Use new icon 2025-01-09 00:27:28 +01:00
schroda d66b3eb38d Handle main content screen right safe area 2025-01-08 23:59:26 +01:00
schroda 33162e70b0 Center delete icon in mutable list setting 2025-01-08 00:34:51 +01:00
schroda 054e837139 Move "readerType" "Webtoon" value migration to 3rd migration
Does not matter since it will only affect stable users which haven't had these migrations applied yet anyway
2025-01-06 12:51:43 +01:00
schroda feebd93555 Properly delete metadata during key deletion migration 2025-01-06 12:39:39 +01:00
schroda 6e0d1cfd3d Simplify metadata app key prefix migration 2025-01-06 12:23:41 +01:00
schroda 3d7a4146e4 Handle metadata key deletion early exit
In case no keys had to be deleted it always returned an empty object which broke the whole metadata migration and resulted in the final metadata to always fall back to the default values
2025-01-06 01:58:49 +01:00
schroda 9f42b75eee Prevent applying already applied metadata migrations again
The "appliedMigrationId" was converted to it's index of the "METADATA_MIGRATIONS" and then was compared to the "migration id" which starts at 1 instead of 0
2025-01-06 01:45:46 +01:00
schroda 724319b6c5 Only commit metadata migration changes of newly applied migration
Changes got commited everytime regardless off if the migration had already been applied
2025-01-06 01:42:42 +01:00
schroda d87fa3721e Migrate old reader settings II 2025-01-05 15:29:56 +01:00
schroda 05ce572c67 Add logic to delete metadata on migration 2025-01-05 15:29:56 +01:00
schroda bb473276a7 Handle multiple prefixes in metadata key migration
Was never updated after the change that made it possible that metadata can have multiple prefixes (e.g. device names)
2025-01-05 15:29:55 +01:00
schroda ab2b1b2218 Handle multiple prefixes in metadata value migration
Was never updated after the change that made it possible that metadata can have multiple prefixes (e.g. device names)
2025-01-05 15:29:54 +01:00
schroda d657ad3999 Commit new metadata after migration 2025-01-05 15:29:51 +01:00
schroda 040584989e Migrate metadata once instead of when reading a value 2025-01-05 14:54:37 +01:00
schroda 258b26f837 Remove unnecessary function exports 2025-01-05 14:54:20 +01:00
schroda 65da9db123 Correctly read last applied migration id from metadata 2025-01-05 14:53:52 +01:00
schroda 1533e37623 Add "migration" to global metadata keys 2025-01-04 21:31:47 +01:00
schroda a51d81d267 Extract "MetadataReader" functions 2025-01-04 21:28:26 +01:00
schroda b7971f5183 Move "getAppMetadataFrom" to "MetadataMigrations" 2025-01-04 21:27:51 +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 1b1ddeb334 Show "info" toast severity by default
The default severity of MUI is "success"
2025-01-04 16:28:16 +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
schroda 62155005ab Apply auto vertical progress bar for BOTTOM position only
In case "auto vertical position" is not "OFF" but the main position is not "BOTTOM", the auto mode still should be considered to be "OFF"
2025-01-02 22:22:31 +01:00
schroda 52f5415c9f Memoize mobile progress bar position related styling
Only really relevant for the "progress bar slot" prop to prevent the slots from unnecessary re-rendering, since depending on the total pages, this can impact the render performance on page changes heavily
2025-01-02 22:22:30 +01:00
schroda b5a0ec7371 Ignore reading direction for vertical progress bar
The page change handling of the progress bar was inverted while RTL was the set readers reading direction.
However, this is only relevant for the horizontal progress bar
2025-01-02 21:48:23 +01:00
schroda f90e4597f8 Make mobile progress bar position changeable 2025-01-02 21:48:02 +01:00
schroda 92892e6604 Optionally adjust progress bar position based on available size 2025-01-02 21:26:19 +01:00
schroda 4aa144cb25 Make minimized standard progress bar gaps transparent 2025-01-02 14:43:01 +01:00
schroda 87a1a67880 Use static hide timeout for all reader setting previews
The default timeout of "notistack" is 5s by default, however, this makes it more clear and also prevents any behaviour changes in the future, in case the default timeout gets changed
2025-01-02 03:22:25 +01:00
schroda af8ada9a62 Always add close button to snackbars 2025-01-02 03:04:14 +01:00
schroda ed992046cb Remove unintentional touch bindings
Caused double clicks
2025-01-02 02:41:42 +01:00
schroda 2944252d91 Make chapter transition warnings optional 2025-01-01 17:24:36 +01:00
schroda e199b75756 Show correct download queue removal failure 2025-01-01 16:44:18 +01:00
schroda f13e8eb412 Fix converting pages to double page mode 2024-12-31 17:17:54 +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 8c147b797a Properly detect if image fills whole viewport
The thresholds are only for detecting if a specific side of the image is in the viewport.

For the check if the image fills the whole viewport, the thresholds incorrectly detect this depending on the readers reading direction.

E.g. in the continuous horizontal pager with theme direction LTR and reader reading direction RTL, the left threshold will be the total width of the viewport plus one which will lead to out of view images to be detected as completely filling the viewport
2024-12-31 16:51:28 +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 c2c4115c9c Reset reader settings state on exit 2024-12-31 14:52:50 +01:00
schroda 7f04f1c860 Consider unset reader chapter as still loading
In case the "currentChapter" is undefined, it means that the state has not been set yet.
In case the "currentChapter" does not exist, it would be set to "null".
2024-12-31 14:52:49 +01:00
schroda 83e8a5fec1 Correctly check if reader chapter exists
As explained in c70287363a8e9308fc294baf83c5656a21a479b1, the "chapterSourceOrder" does not start at 0, thus, in case it's the last known chapter, "doesChapterExist" was always false due to subtracting 1 of the total chapters
2024-12-31 14:52:48 +01:00
schroda 899364ac85 Use proper name for reader url chapter "index" param
It's not the index of the chapter but the source order, which is starting at 1 and not 0
2024-12-31 14:52:47 +01:00
schroda 17cf8ec9d0 Update "pagesToSpreadState" during render
Gets rid of an unnecessary rendering
2024-12-31 13:25:37 +01:00
schroda 3bab657c52 Update "actualPages" immediately
Instead of immediately updating the value once the page count changed, it got updated after "pagesToSpreadState" changed, which was after the rendering finished.

This was the actual root cause of what was tried to be fixed with 9ab6ec89c7
2024-12-31 13:24:29 +01:00
schroda 36ae02d2bd Revert "Fix page resume in continuous pagers"
This reverts commit 9ab6ec89c7.
2024-12-31 12:46:25 +01:00
schroda 8594a7b178 Increase reserved "current page" text for double pager
For the double pager the current page text needs more reserved space since two pages are displayed at once which changes the current page text to "<page1>-<page2>" instead of just "<page1>"
2024-12-31 04:38:11 +01:00
schroda a0df80f60a Fix opening previous/next page via user action
Regression 55dc9471d9
2024-12-31 04:24:47 +01:00
schroda 9ab6ec89c7 Fix page resume in continuous pagers
The image refs weren't always set by the time the last read page got resumed.
Thus, the last read page never got scrolled into view
2024-12-31 04:05:53 +01:00