Commit Graph

53 Commits

Author SHA1 Message Date
schroda
7531edbd59 Add retry logic to Library error handling 2024-04-28 02:58:28 +02:00
schroda
473e85a8ed Feature/use second level mui imports (#743)
* Require "Theme" to be passed to "SxProps"

Decreases typescript performance otherwise

* Disallow "top" and "third-level" MUI imports

* Exclude "node_modules" in tsconfig
2024-04-14 15:50:12 +02:00
schroda
ecd9b7478b Add range selection (#707) 2024-04-05 02:03:00 +02:00
schroda
dcbf5a1899 Fix/library manga selection type error (#566)
* Prevent TypeError when deselecting items from a specific key

This was noticed when changing the categories of a manga to a category without any selected mangas, in this case, when trying to deselect a manga after changing the categories, a TypeError was thrown which resulted in a white screen

* Remove duplicates from the list of all selected ids

* Update state via setter

* Clear selection after disabling the library selection mode

* Remove console log
2024-01-21 22:31:43 +01:00
schroda
6708a958ce Render selection fab in case only one category exists (#553) 2024-01-15 21:19:35 +01:00
schroda
db65b9df44 Feature/merge source and extensions screen on desktop (#535)
* Merge "source" and "extension" screen for desktop

* Move "tab" related components into new folder

* Reuse "tab" components for "browse" screen

* Prevent extension list from being taller than 100% of the parents height

- remove margin - virtuoso has issues calculating the height otherwise
- change group title styling, fontSize caused issues

* Align "source" list group header with "extension"

* Remove bottom padding from "ExtensionCard"

* Move "GroupedVirtuoso" related components into folder

* Use "GroupedVirtuoso" for "extensions"

There was an issue with the height calculation of the virtuoso list, which apparently was caused by the conditional rendering of the group title and item as list items.
Due to this, while scrolling down, the virtuoso list caused an overflow, which rendered the scrollbar, which in turn caused the list items to shrink in width.
The end result of this was, that the list items "jumped" slightly on the initial render of the items, due to the scrollbar appearing and disappearing
2024-01-02 23:32:49 +01:00
schroda
edc2a62a76 Feature/cleanup files (#528)
* Move menu components into new dir

* Move chapter components into new dir

* Extract menu helper functions

* Move "SelectionFAB" to "collection" dir

* Move debounce hook to global utils dir

* Rename manga "hooks" to "useRefreshManga"
2023-12-30 14:30:04 +01:00
schroda
ecea80f41e Merge manga action menus (#527) 2023-12-30 14:26:50 +01:00
schroda
d15be603b1 Use up-to-date manga data for selection fab actions (#526)
The selected manga data was only updated in case the selection changed, thus, after executing an action, the used data was outdated
2023-12-30 04:04:47 +01:00
schroda
446deeae06 Feature/library manga actions (#506)
* Extend "IMangaGridProps" from "DefaultGridProps"

* Move library manga filtering into hook

* Add logic to select mangas

* Add manga actions

* Remove cache only policy for category mangas

Unclear why this was added

* Prevent SelectionFAB from being hidden by the mobile footer

On e.g. the library page, the footer is visible and thus, the fab was not completely visible

* Update categories of manga only after clicking "OK"

Previously, selecting a category resulted in an immediate mutation.
To be able to reuse the "CategorySelect" component to change the categories of multiple mangas at once, this behaviour is not suited.

* Add action to change categories of multiple mangas

* Cancel selection mode after removal from library

The mangas would still be selected and other action could get performed. However, this should only be possible for mangas that are in the library

* Remove unintentionally added console log

Accidentally added with 980da657d9
2023-12-25 21:37:45 +01:00
schroda
0615ef87ce Add divider between library tabs and mangas (#514) 2023-12-25 21:15:52 +01:00
schroda
1300c10d83 Remove unnecessary library refetch
The server is now returning up-to-date manga data and thus, it's not necessary to refetch the library anymore after the update is finished
2023-12-16 20:43:11 +01:00
schroda
5a5b12a9e1 [ESLint] Prefer named exports (#427) 2023-10-28 00:32:02 +02:00
schroda
09c7e804ba Refresh library mangas after update
the gql updater subscription currently return stale data, thus, the mangas do net get updated in the cache
2023-10-27 21:03:37 +02:00
schroda
b6382bb33a Load only category mangas that are in the library 2023-10-27 20:23:47 +02:00
schroda
b3a432ed2e Update typings 2023-10-27 20:23:46 +02:00
schroda
d3e15e9d3b Use gql for "subscriptions" 2023-10-27 20:23:45 +02:00
schroda
af9d49e5e9 Use gql for "mangas" II - category mangas 2023-10-27 20:23:04 +02:00
schroda
ca18e750bf Use gql for "categories" 2023-10-27 20:23:03 +02:00
schroda
bffc1669e2 Move "RequestManager" in sub folder 2023-10-27 20:23:00 +02:00
schroda
5279339b86 Feature/update i18next to v23.x (#391)
* Update i18next to v23.x

Update to version 23.2.7

* Use new "ParseKeys" (old: "TFuncKey") type

* Remove unnecessary casts to string

Not needed anymore with the latest version
2023-07-04 21:53:25 +02:00
schroda
4dcf6a3ad9 Make library tabs menu position fixed (#369) 2023-06-17 16:55:24 +02:00
schroda
938b5166d9 Fix Library tab change animation (#372) 2023-06-17 15:45:52 +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
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
a457d80c44 Feature/streamline backend requests (#297)
* Introduce "RequestManager"

* Use "RequestManager" - Simple replacements

 - Get rid of all "util/client" imports
 - replace old requests with new "RequestManager"
 - remove "fetcher" from global SWR config
     instead of using the SWR hooks by themselves, the "requestManager" is supposed to be used

* Use "RequestManager" - Do requests via SWR hooks

Use SWR hooks at places where it's easily usable

* Prevent trailing slashes in the "baseUrl"
2023-05-18 13:25:19 +02:00
schroda
58eb2fead3 Feature/enforce license notice in each file via eslint rule (#304)
* [ESLint] Add "eslint-plugin-header" as dev dependency

* [ESLint::eslint-plugin-header] Setup rule

* [ESLint::eslint-plugin-header] Fix errors
2023-05-18 13:17:41 +02:00
schroda
8dae72604f Update to SWR version 2.x (#296)
* Update SWR to version 2.1.5

* Improve generic type names

* Use "isLoading" property of "useSWR" response

* Correctly load library without selected tab

With the latest SWR version the library was empty on the first load.
Not sure what exactly is the reason, but due to "isPaused" the request wasn't sent even after "activeTab" wasn't undefined anymore.
Instead of using "isPaused", passing "null" as the key will also prevent SWR from doing the request.
2023-05-15 11:56:55 +02:00
schroda
79b2305e54 Feature/library show number of mangas in category (#269)
* Pass optional browser tab only title

Makes it possible to have a different title for the "NavBar" and the browser tab

* Show number of items in category and library

---------

Co-authored-by: schroda <github@dasch.simplelogin.com>
2023-04-22 11:39:59 +02:00
schroda
b1dc13cd30 Update browser and nav bar title on language change (#275) 2023-03-29 00:44:03 +03:30
schroda
d58bd6cd92 add translation keys (#246)
* Fix i18n tsc issue

"t" can return null by default.
This was already disabled in the config, but it had no effect on tsc.

* Fix translation in "DefaultNavBar"

key was missing and since this is a constant the translation wouldn't update in case the language got changed after first load.

* Enable typing for i18n translation keys

* Add translation keys
2023-03-23 16:29:32 +03:30
schroda
23001a4298 update react scripts dependency (#255)
* Move "dependencies" close to "devDependencies"

Makes it easier to have a quick overview

* Upgrade "react-scripts" to latest version

With new versions of node (> v16) the build scripts fails with the following error "error:0308010C:digital envelope routines::unsupported"

* Upgrade "react-scripts" to v5 - Fix import

* Upgrade "eslint" dependencies

The latest version of "react-scripts" uses eslint v8 causing the following error "... ERROR in Plugin "react" was conflicted between ".eslintrc.js" >> eslint-config-airbnb ..."

* Upgrade "eslint" dependencies - Allow nested components as props

* Upgrade "eslint" dependencies - Fix lint issues
2023-03-11 20:35:58 +03:30
Daniel
96fd1cf73b remove manually created typing d ts file (#249)
* Rename file

".d.ts" files are files that are automatically generated during compilation (in case option is set) and shouldn't be created manually.

* Export types and interfaces

* Add missing imports
2023-02-24 19:10:37 +03:30
Aria Moradi
688358f673 add translation keys 2023-02-14 16:47:38 +03:30
Aria Moradi
76d44bd657 clean up translations 2023-02-14 16:28:37 +03:30
Aria Moradi
1c7c3e566c add i18n (#239) 2023-02-13 20:21:44 +03:30
akabhirav
aaedbb7be9 add pagination to library and fix some prettier issues (#237)
Co-authored-by: akxer <>
2023-02-12 18:43:41 +03:30
Daniel
2c11708c92 increase prettier line length to 120 (#233)
* [Prettier] Increase max line length to 120

100 is quite low, especially on modern monitors.
The length is also reached quite quickly with 4 spaces per tab depending on the indentation depth

* [Prettier] Increase max line length to 120 - Fix formatting
2023-02-08 20:49:26 +03:30
Daniel
4e0a860dfd add prettier for auto formatting (#231)
* [Prettier] Add "prettier"

Makes the formatting of the code consistent.
By using the eslint-plugin-prettier formatting issues will be highlighted as a lint error.
These errors will be auto fixed by running "lint --fix" (which can be done automatically on file save)

* [Prettier] Add "prettier" - Fix formatting
2023-02-06 12:36:33 +03:30
Daniel
2eeea41a45 force absolute import path (#223)
* Add "no-relative-import-paths" eslint plugin

* Add "no-relative-import-paths" eslint plugin - Fix imports
2023-02-05 18:45:20 +03:30
Daniel
7642b5808c [#211] Refresh Library after a update (#212)
Library had to be refreshed manually to see the latest manga updates.
2023-01-06 20:05:26 +03:30
Valter Martinek
154b357c40 Options panels refactoring (#196)
* Refactor library options to match chapter options using shared component

* Disable some eslint rules

* Cleanup SourceOptions layout to use same components as other panels
2022-11-24 12:11:03 +03:30
Valter Martinek
4a4e8b2cde Feature/batch chapter download (#191)
* Add NavbarToolbar component for rendering items in toolbar through portal

* Refactor Manga screen, move chapters filtering to toolbar menu, cleanup ChapterOptions

* Fix warning

* Update layout of ChapterList and add selection for chapters, add batch download, move stuff around

* Add space to bookmark icon

* Clear actions when leaving source mangas page

* Move bookmark icon back inline and align it correctly with text

* Fixup MangaDetails buttons to update cache properly so buttons in manga menu are updated

* Move chapters filter to ChapterList

* Fixup error display overlapping with loaded content when revalidation fails

* Fixup spacing around ChapterList title

* Only show small progress if manga is loaded so there is not to many spinners

* Prevent title wrapping

* Add icon buttons to desktop sizes of manga toolbar menu
2022-11-09 20:39:15 +03:30
Valter Martinek
14265164a4 Feature/swr for simple queries (#187)
* Refactor simple queries with useSWR hook

* Fix plus button in Extensions screen

* Add type to categories query

* Add useQuery abstraction which adds loading attribute

* Reload categories even if reorder fails
2022-11-03 00:18:22 +03:30
Valter Martinek
6f8755fa05 Feature/swr for library screens (#186)
* Wrap data fetching in library and manga screen with swr for better dev and user experience. Refactor some API calls and data handling. Add manual refresh to manga detail.

* Fix manga card layout

* Fix refresh button position on small screens

* Revert "Fix manga card layout"

This reverts commit d85da3d8385e1ef64feed1789e4cd4591c8bd563.

* Fix manga not setting title

* Move chapters loading to Manga component, join data fetching, add auto online fetch if fetched data is old

* Revert some changes
2022-11-02 13:12:02 +03:30
amr
365f28fee5 added an update checker button for library (#172)
* added an update checker button for library

* fixed import path

* fixed progress props to not be inline

* added error handling

* fixed linting issue
2022-04-18 12:56:36 +04:30
Aria Moradi
7eedce62cd handle search shortcuts (#116)
* code cleanup

* fix some issues

* handle search keyboard shortcuts
2021-12-19 18:06:27 +03:30
Aria Moradi
03d09b2e92 cleanup library (#107)
* refactor library

* handle invalid tab numbers
2021-11-19 16:36:02 +03:30
abhijeetChawla
0a89d227db Save tabs number in Url to persist tab when go to other paths (#78)
* added an optional  url parameter to the library path to get to a particular tab

* Added Error checking when taking the parameter from the Url

* Now Tabs persist with library options

* FIxed a bug which made the backbutton appear in the Library route when tabs number was presents in the url
2021-11-17 14:10:04 +03:30