Commit Graph

2296 Commits

Author SHA1 Message Date
schroda
67b4bbbdcf Do not use and mutate global array 2023-06-24 12:41:27 +02:00
schroda
5c0dcf1f6c Rename function 2023-06-24 12:41:27 +02:00
schroda
084308a833 Fix typo 2023-06-24 12:39:01 +02:00
schroda
95ca2fabae Group obsolete extensions 2023-06-24 12:39:01 +02:00
schroda
2bbfb5272f Add new languages to resources 2023-06-24 12:38:37 +02:00
Hosted Weblate
750d2f2464 Translated using Weblate (Ukrainian)
Ukrainian: currently translated at 100.0% (201 of 201 strings)

Translated using Weblate (Chinese (Simplified))

Chinese (Simplified): currently translated at 100.0% (201 of 201 strings)

Translated using Weblate (Indonesian)

Indonesian: currently translated at 8.9% (18 of 201 strings)

Translated using Weblate (Chinese (Simplified))

Chinese (Simplified): currently translated at 100.0% (201 of 201 strings)

Added translation using Weblate (Indonesian)

Translated using Weblate (Japanese)

Japanese: currently translated at 3.0% (6 of 200 strings)

Translated using Weblate (Ukrainian)

Ukrainian: currently translated at 100.0% (200 of 200 strings)

Translated using Weblate (Ukrainian)

Ukrainian: currently translated at 100.0% (199 of 199 strings)

Translated using Weblate (Chinese (Simplified))

Chinese (Simplified): currently translated at 61.1% (121 of 198 strings)

Translated using Weblate (Ukrainian)

Ukrainian: currently translated at 100.0% (198 of 198 strings)

Translated using Weblate (Ukrainian)

Ukrainian: currently translated at 100.0% (197 of 197 strings)

Translated using Weblate (Chinese (Simplified))

Chinese (Simplified): currently translated at 60.7% (119 of 196 strings)

Translated using Weblate (Ukrainian)

Currently translated at 100.0% (196 of 196 strings)

Translated using Weblate

Co-authored-by: Dan <denqwerta@gmail.com>
Co-authored-by: Dan <jonweblin2205@protonmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Rafie Rafie <rafiedanr@gmail.com>
Co-authored-by: Super Mario <supermario22922@gmail.com>
Co-authored-by: misaka10843 <misaka10843@outlook.jp>
Co-authored-by: schroda <github@mail.schroda.net>
Co-authored-by: 娃哈哈 <1045188196xsj@gmail.com>
Co-authored-by: 蓝云Reyes <i@muir.fun>
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/de/
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/id/
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/ja/
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/uk/
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/zh_Hans/
Translation: Suwayomi/Tachidesk-WebUI
2023-06-22 21:51:03 +02:00
蓝云Reyes
5d9bc5474c Prevent white screen in Updates page (#383) 2023-06-22 21:40:41 +02:00
schroda
ed9c51cd37 Reset scroll position when changing the search term (#382)
I hate my life (f5a8c8d35c)... AINTNOWAY
2023-06-20 01:12:10 +02:00
schroda
322cf8c915 Move Library "search settings" to LibrarySettings (#381) 2023-06-20 01:00:54 +02:00
schroda
f5a8c8d35c Update reset scroll position flag after doing the reset (#380)
Should have been added with 3ad33b0a15
2023-06-20 00:59:19 +02:00
schroda
79b5e696b6 Fix/setting buttons unclickable area (#379)
* Move "onClick" handler to "ListItemButton" - LibrarySettings "global update categories"

Clicks were only handled on the button content leading to a small area around the content to not handle the clicks, thus, not opening the dialog

* Move "onClick" handler to "ListItemButton" - Settings "manga item width"

Clicks were only handled on the button content leading to a small area around the content to not handle the clicks, thus, not opening the dialog
2023-06-20 00:58:40 +02:00
schroda
0f029cb625 Fix/library manga grid infinite item size on category switch (#378)
* Revert "Fix/manga grid infinite item width (#376)"

This reverts commit 48d559ec

This fixed (and worked as expected in dev mode) the very rare issue in dev mode (you had to load the page with a small screen size and increase the screen size before the grid and grid items were rendered) and caused it frequently in production build in the Library grid when switching categories

* Fallback grid dimensions to current window dimensions

Hook only run once, which could lead to an issue where the grid item width was calculated to be infinite (e.g. in SearchAll due to strict-mode behaviour in the dev mode).
Could be that this is only an issue in dev mode due to react-strict mode.

* Remove unused "height" grid dimensions property
2023-06-17 22:31:59 +02:00
schroda
cdacc4b2a9 Always use available width for grid items (#375)
In case a manga thumbnail was smaller than the set item width, the item didn't use all its available width.
Thus, being smaller than the other items.
2023-06-17 20:54:55 +02:00
schroda
ad38641616 Only show scrollbar when necessary (#377) 2023-06-17 20:53:44 +02:00
schroda
48d559ec19 Fix/manga grid infinite item width (#376)
* Calculate GridItem width once

Was unnecessarily calculated on every item render

* Update grid dimensions everytime the height or width changes

Hook only run once, which could lead to an issue where the grid item width was calculated to be infinite.
Could be that this is only an issue in dev mode due to react-strict mode.
2023-06-17 20:53:08 +02:00
schroda
4dcf6a3ad9 Make library tabs menu position fixed (#369) 2023-06-17 16:55:24 +02:00
schroda
19d27fdf26 Feature/virtualize manga grid (#363)
* Disable ssr by default for "useMediaQuery"

SSR would cause the hook to run once with default values and only after the first render with real values.
This can cause issue on rendering when depending on useMediaQuery results like in 8c129f2e08

* Virtualize manga grids

* Remove SourceMangas load more guard

Was required due to the previous load more trigger logic from the MangaGrid.
Due to using Virtuoso now, load more will be triggered only once when the bottom of the grid was reached and thus won't trigger multiple load more requests

* Remove old Library pagination

Pagination is handled by virtuoso, thus, the previous pagination can be removed

* Increase initial loaded pages to make infinite load work

virtuoso requires enough initial items to be rendered, so that actual virtualization takes effect, for it to fire "endReached"

* Prevent virtuoso grid scrollbar from jumping around

In case the items have a big height difference there is a bug where the scrollbar starts jumping around the moment these new items are rendered

* Restore scroll position

For some reason the UI jumps around when accessing "document.documentElement" during loading more items.
After the items are rendered the loading placeholder gets removed and the previous items jump to the bottom of the viewport.

* Limit manga grid titles to two lines

* Remove "last page" info from MangaGrid

Info is not needed. The only thing the MangaGrid has to do is to trigger a request to load more data
2023-06-17 16:50:17 +02:00
schroda
3ad33b0a15 Reset scroll position when changing searchTerm (#373) 2023-06-17 16:29:55 +02:00
schroda
938b5166d9 Fix Library tab change animation (#372) 2023-06-17 15:45:52 +02:00
schroda
05fa6d8fa9 Never pass "searchTerm" for "filter" source content type request (#371)
There was an issue when switching from the "search" back to the "filter" source content type.
The "filter" request returned the data from the search request and thus, showed invalid data until the correct data was loaded instead of showing the loading placeholder
2023-06-17 15:45:43 +02:00
schroda
0495a932de Use the "disableCache" flag for the "filters" source content type request (#370) 2023-06-17 15:45:18 +02:00
schroda
64eb420ba6 Use same endpoint for search in SearchAll and SourceMangas (#368)
SearchAll used a different search endpoint and thus, the already requested pages for the search weren't reused and instead had to be requested again since the swr cache key was different
2023-06-17 15:45:06 +02:00
schroda
97c77027f2 Scroll to top when changing source manga content type (#365) 2023-06-16 00:15:13 +02:00
schroda
5187d4c842 Fix "hasNextPage" calculation for Library grid (#366)
"totalPages" could have decimal places which then would lead to incorrectly disabling the "hasNextPage" flag
2023-06-16 00:15:00 +02:00
schroda
cc4bf7bb32 Fix initial infinite swr request for pages > 1 (#367)
In case more than 1 page was requested for the initial request, there was a problem in case the first page already had no results.
In that case the request for the second page always returned with the "isLoadMore" and "isLoading" flag set to true.
Thus, incorrectly indicating that the request is still active.
The "actual" request was already finished, but internally the "isLoadMore" flag was set incorrectly due to not considering if an actual request is active.
2023-06-16 00:14:22 +02:00
schroda
dcd5302a26 Fix/source mangas white screen when directly open page via url (#362)
* Correctly handle missing location state

In case the view gets opened directly via url, there won't be any location state.
This leads to a TypeError when trying to get "contentType" from the location state.
Issue was introduced with 4e8813b526 where the function was adapted incorrectly with code that will never work (good job me KEKW)

* Add info about dev mode + strict mode issue
2023-06-10 00:42:26 +02:00
schroda
26b48f15c5 Fix/library settings global update categories empty dialog after updating (#361)
* Prevent dialog not to showing any categories after updating them

After updating to react v18 the dialog categories were empty after updating the category changes

* Immediately close the dialog after starting update

Catalog was open as long as the update was running

* Remove unnecessary state
2023-06-10 00:42:10 +02:00
schroda
63c1ac95eb Feature/remove use back to util (#360)
* Remove "useBackTo"

Not needed

* Use browser back navigation to close the reader

This will cause the previous page (manga or updates) to be opened instead of always opening the manga page
2023-06-08 14:25:24 +02:00
schroda
bbdbccf235 Prevent chapter revalidation on focus event in the Reader (#359)
This caused the reader to scroll back to the beginning of the current page.
And with the latest changes of 7f83bb9a0a the loading state was shown.
2023-06-08 13:56:25 +02:00
schroda
7f83bb9a0a Do not use stale chapter data for the reader (#358)
This caused the chapter to be loaded with stale data (the old lastPageRead state) and then jumping to the actual lastPageRead after the latest data was received.

It's not possible to mutate the chapter when updating lastPageRead since this causes the reader to always jump back to the just set lastPageRead when scrolling
2023-06-08 13:46:55 +02:00
schroda
67e554ede6 Prevent updating "lastPageRead" of chapter to the initial chapters "lastPageRead" (#357)
This could cause racing conditions with the chapter load which lead to the lastPageRead to be reset to 0
2023-06-08 13:43:58 +02:00
schroda
21174dc04a Add the option to ignore SWR stale data (#356) 2023-06-08 13:40:50 +02:00
schroda
f979d207e8 Open reader via the correct url when using resume FAB (#355)
With the recent update to react-router-dom v6 the route "manga/:mangaId/chapter/:chapterIndex/page/:pageIndex" doesn't get matched anymore.
The "pageIndex" is also unnecessary since it doesn't get used and instead the chapters "lastReadPage" property gets used to resume the chapter.
2023-06-08 13:40:38 +02:00
schroda
cce6ec0113 Preserve "SourceMangas" location state (#354)
Due to setting the "defaultBackTo" url the back button was a Link instead of a normal Button.
The Link causes the page to get opened like it's the first time and to get put on top of the browsers history stack. Instead of actually going back in the history.
Thus, the previous location state of the "SourceMangas" page was lost and the content type (browse, latest, filter) couldn't be reopened.
2023-06-08 13:40:08 +02:00
schroda
4b83ccc889 Feature/use alias for imports (#352)
* Use alias "@" for imports

* Use alias "@" for imports - Fix imports

* Use alias "@" for imports - Prevent faulty "import/extensions" linting issue

For some reason the rule throws an error for alias imports

* Use alias "@" for imports - Update "no-relative-imports" eslint rule
2023-06-05 01:42:39 +02:00
schroda
1ec6d77598 Fix/library title size info initial render flickering (#350)
* Rename variable

* Hide size tag until tabs data was loaded

The wrong loading state (mangas) was being used to check if the size tag can be shown.
2023-06-05 01:24:56 +02:00
schroda
00e403ce09 Use correct endpoint for deleting downloaded chapter (#351)
Instead of deleting the downloaded chapter, a request was made to remove the download from the download queue
2023-06-05 01:23:40 +02:00
schroda
61975b5c49 Feature/update dependency react to v18.x (#346)
* Update dependency "react" to v18.x

Update to v18.2.0

* Update dependency "react" to v18.x - Fix some dependency version issue

Something caused weird tsc issues, most likely a version mismatch since it got fixed by doing a clean install (deleting node_modules folder, yarn.lock and clearing the cache) of the dependencies

* Update dependency "react" to v18.x - Fix "i18n" tsc issues

* Update dependency "react" to v18.x - Fix tsc issue

Typography can only have a single child

* Update dependency "react" to v18.x - Prevent build warning

TODO: migrate to Vite

Gets used without being declared as a dependency.
Since CRA is unmaintained this will not get fixed.

* Update dependency "react" to v18.x - Use "createRoot"

* Update dependency "react" to v18.x - Fix dnd in strict mode
2023-06-04 21:40:04 +02:00
schroda
4e8813b526 Feature/update dependency react router dom to v6.x (#340)
* Update dependency "react-router-dom" to v6.x

Update to v6.11.2

* Update dependency "react-router-dom" to v6.x - Replace "Switch" with "Routes"

* Update dependency "react-router-dom" to v6.x - Relative paths

* Update dependency "react-router-dom" to v6.x - Nested routes

* Update dependency "react-router-dom" to v6.x - Prevent route warnings

 - Route without an element causes a warning message.
 - Routes with non-matching Route causes a warning message.

* Update dependency "react-router-dom" to v6.x - Replace "useHistory" with "useNavigate"

* Update dependency "react-router-dom" to v6.x - Fix "Link" usage

* Update dependency "react-router-dom" to v6.x - Overwrite "useParams" and "useLocations" typing

For both functions it's the users fault if they are getting used incorrectly.
It's inconvenient to always have to make sure the params exist (useParam) or to cast the return object to a specific type (useLocation)

 - "useParams": Make generic type non-optional
 - "useLocation": Add generic type

* Update dependency "react-router-dom" to v6.x - Fix use-query-params provider
2023-06-04 21:30:15 +02:00
schroda
6b05083d95 Feature/update dependency use query params to v2.x (#338)
* Update dependency "use-query-params" to v2.x

Update to 2.2.1

* Update dependency "use-query-params" to v2.x - Fix provider

Update to 2.2.1
2023-06-04 21:27:09 +02:00
schroda
1ce27ea939 Feature/update dependency mui to v5.x (#332)
* Update dependency "mui" to v5.x

Update to v5.13.3

Fixes issue of "SxProps" not being exported by "@mui/material"

* Update dependency "mui" to v5.x - Fix grid item size

Update to v5.13.3

Fixes issue of "SxProps" not being exported by "@mui/material"

* Update dependency "mui" to v5.x - Replace "ListItem" with "ListItemButton"

* Update dependency "mui" to v5.x - Fix tsc issue

* Update dependency "mui" to v5.x - Prevent reader white screen

Due to "initialChapter" being a function returning an object, it causes a re-render everytime due to it (the object) being used as a dependency.
This caused a white screen when skipping to the previous or next chapter
2023-06-04 21:13:07 +02:00
schroda
6911f60eb4 Feature/remove dependency mui system (#331)
* Remove duplicated dependency "@mui/system"

Already included in "@mui/material"

* Remove duplicated dependency "@mui/system" - Fix theme "custom" palette

Already included in "@mui/material"

* Remove duplicated dependency "@mui/system" - Fix imports

Already included in "@mui/material"
2023-06-04 21:08:39 +02:00
schroda
2a6950b015 Feature/remove dependency mui styles (#330)
* Remove deprecated dependency "@mui/styles"

* Remove deprecated dependency "@mui/styles" - Remove usage
2023-06-04 20:58:44 +02:00
schroda
9ae7b2e592 Remove console log (#327)
The 2nd time this happens... AINTNOWAY
2023-06-04 01:03:45 +02:00
schroda
0fb204f141 Feature/request manager remove get client usage (#325)
* Remove "getClient" usage from "metadata" util

* Remove "getClient" usage from "useRefreshManga" hook

* Remove "getClient" usage from "isDupChapter" util function

* Use correct endpoint for setting category metadata

"/meta" suffix was missing from url

* Use correct http method for updating manga metadata
2023-06-04 00:50:58 +02:00
schroda
207a87f3e9 Fix import backup file request (#326)
The file wasn't send correctly due to converting it to a string.
2023-06-04 00:32:08 +02:00
schroda
eaa8392789 Fix axios requests (#324)
The response was the expected data and not the actual axios response.
Thus, there was no "data" property and trying to use it could lead to errors like e.g. TypeErrors.
2023-06-04 00:30:48 +02:00
Alexandre
d60ed0c055 Add fit page to window reader setting (#323)
* Add fit page to window reader setting

* Renamed option and conditional rendering

* Rename translation key
2023-06-03 20:53:52 +02:00
schroda
46a7ff6e3b Feature/refactor source mangas screen (#314)
* Refactor "SourceMangas"

* Refactor "SourceMangas" - Show loading placeholder on filter reset or submit

Due to the url being the same for all "filter requests" the loading state doesn't get changed by SWR.
Instead, only the "isValidating" state gets updated.

* Refactor "SourceMangas" - Update routing

* Refactor "SourceMangas" - Prevent duplicated mangas in grid

There is a possibility that the "latest" endpoint returns the same manga on different pages

* Always set the toolbar content on the manga page

"setAction" wasn't called on the manga page, thus, in case the previous page didn't unset the action, it never got unset

* Rename source content type "Browse" to "Popular"
2023-05-28 12:16:06 +02:00
schroda
1480507c35 Fix/source options filters state (#320)
* Prevent mutating passed object

Causes the options to not get reset correctly and/or to get set without "submitting" them

* Always use local filter state instead of requested one

The local filter state sometimes got overwritten by the state from the server response.
This resulted in showing an incorrect filter state while still sending the correct one to the server when filtering

* Update text filter faster

The timeout (2.5s) is too long and can cause the filter state to not have been updated by the time the filters are getting submitted.
Thus, causing a request with outdated filters and requiring a "re-submit" for the actual filters to get used.
2023-05-28 02:18:37 +02:00