Commit Graph

154 Commits

Author SHA1 Message Date
schroda
f570b7c9ed Optionally hide history 2025-03-22 01:16:38 +01:00
Jack
9e5fa7d81a Add history page (#897)
* Add History module and integrate it into the app

Introduce the History module with components for displaying chapter updates, including UI for grouped updates by date. Update routing and constants to incorporate the new /history path.

* Replace "Updates" and "History" with unified "Recent" module

Merged the "Updates" and "History" screens into a single unified "Recent" module with corresponding navigation updates. Adjusted GraphQL types and localization files to reflect the changes. This simplifies navigation and improves user experience.

* Refactor History screen to remove unused components.

Removed unused states, layout effects, and props related to last update timestamp. Renamed variables for better clarity and updated labels and error messages to align with the history context. Simplified component structure for improved maintainability.

* ```
Refactor tab handling and integrate dynamic height adjustments.

Renamed enums for better clarity and consistency. Implemented a `tabsMenuHeight` prop to dynamically adjust component layouts based on observed height changes using `useResizeObserver`. Updated the `Updates` component to consider the calculated heights for improved rendering.
```

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* Refactor `groupByDate` parameter and add `lastReadAt` field

Renamed `updates` to `histories` in `groupByDate` for clarity and added a debugging log for input data. Updated GraphQL fragment to include the `lastReadAt` field to support additional functionality.

* "Optimize GraphQL type definition formatting in generated file

Condensed the formatting of the GetChaptersHistoryQuery type to a single line for improved readability and consistency. This change does not affect functionality but enhances maintainability of the generated code."

* Remove UpdateChecker component from History screen

The UpdateChecker component and its related navbar action have been removed from the History screen. This simplifies the navbar setup and eliminates unused functionality in this context.

* Refactor chapter fragment and type references

Updated `ChapterRecentListFieldsFragment` to `ChapterUpdateListFieldsFragment` for better alignment with naming conventions. Adjusted type imports and query structures to maintain consistency across files. No functional changes introduced.

* Refactor padding calculation logic in Updates screen.

Renamed state variable and refactored its logic for clarity and consistency. The updated logic now uses a more descriptive name, `listPadding`, to enhance code readability and maintainability.

* Pass `tabsMenuHeight` prop to History component

Added `tabsMenuHeight` prop to the `History` component to properly calculate the height for the `StyledGroupedVirtuoso` element. This ensures consistency with other components and improves layout rendering.

* Revert package.json

* Add last page read tracking to chapter history

Introduced "lastPageRead" and "pageCount" fields to track progress in chapter history. Updated UI to display the last page read along with total pages for chapters. Adjusted localization files to support the new "page" label.

* Remove last page read display from ChapterHistoryCard

The "last page read" information was removed from the ChapterHistoryCard component for a cleaner UI. This change simplifies the card's design by showing only the chapter name and relevant download state.

* Forcing an empty commit.

* Replace "Recent" screen with separate "Updates" and "History".

The "Recent" feature has been split into two distinct screens, "Updates" and "History", for improved clarity and functionality. Routes, icons, and components have been updated accordingly, and redundant code related to "Recent" has been removed.

* Clean

* Revert vi.json

* Remove unnecessary `useLocation` hook and update state logic.

The `useLocation` hook was removed as it was not used elsewhere in the component. The state property for the routing logic was updated to use `Chapters.getReaderOpenChapterLocationState` for better encapsulation and clarity.

* Update history localization by removing unused "page" key

Removed the "page" key from the "history" section in the localization file as it is no longer in use. This cleanup helps keep the translation file consistent and easier to maintain.

---------

Co-authored-by: NamNH <namitonguyen@gmail.com>
2025-03-10 21:53:40 +01:00
schroda
6afc9f22b6 Introduce "more" page
- moves "Settings" into "more" page
2025-03-09 16:19:31 +01:00
schroda
ca7bd6898e Prevent horizontal scrollbar in snackbar 2025-02-10 23:26:33 +01:00
schroda
94b4bdfa10 Reduce snackbar description length 2025-02-10 23:23:40 +01:00
schroda
a7df8eb0f4 Show image loading placeholder only when visible
The MUI spinner impacts the cpu usage.
While only a few of them don't matter, rendering multiple of them can impact the cpu usage.

This can be a problem in the reader in case a chapter with a lot of chapters is rendered and a continuous reading mode is being used.
In such a case the cpu usage stays increased until all pages have been loaded
2025-02-08 20:12:41 +01:00
schroda
a4e9e8f264 Introduce "useIntersectionObserver" hook 2025-02-08 19:45:41 +01:00
schroda
050094c991 Update styling of "manga open source" button 2025-02-08 16:16:32 +01:00
schroda
f633059083 Rename "CustomIconButton" to "CustomButton" 2025-02-08 16:03:37 +01:00
schroda
36cb545156 Properly detect scrollbar for mouse drag scrolling 2025-02-04 22:35:01 +01:00
schroda
d73bb31df9 Pass non "source props" to "prop source creators" in "withPropsFrom" HOC 2025-02-03 17:17:35 +01:00
schroda
a6f015d5e3 Add comment 2025-02-03 16:30:10 +01:00
schroda
6d47ab05c1 Improve mouse drag detection
Ignore mouse movements in directions where the element does not have a content overflow and thus, scrolling is not possible
2025-02-03 16:30:08 +01:00
schroda
8ddb259c82 Prevent tooltip on disabled button warning 2025-02-02 00:54:03 +01:00
schroda
dc9f6fc863 Fix "Uncaught ResizeObserver loop completed with undelivered notifications" error
Was caused due to creating a temporary div inside a resize observer callback.
By moving the temp div outside the viewport, it does not the trigger resize observer again
2025-01-31 01:54:39 +01:00
schroda
3698c19aba Properly enable cors for images by default 2025-01-26 17:18:27 +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
480eaf5a08 Extract app page history from nav bar context 2025-01-23 13:14:58 +01:00
schroda
eeb811bf2d Handle flex "column-reverse" for mouse drag scrolling inertia 2025-01-21 19:19:29 +01:00
schroda
18a46c0a28 Handle flex "row-reverse" for mouse drag scrolling inertia 2025-01-21 19:19:28 +01:00
schroda
7818fb450d Fix text color of active chapter in chapter list of reader 2025-01-17 01:26:06 +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
ba52e70dbb Improve "Updates" render performance 2025-01-12 20:28:23 +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
33162e70b0 Center delete icon in mutable list setting 2025-01-08 00:34:51 +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
92892e6604 Optionally adjust progress bar position based on available size 2025-01-02 21:26:19 +01:00
schroda
af8ada9a62 Always add close button to snackbars 2025-01-02 03:04:14 +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
8dc5ec339c Decrease "MIN_SCROLL_AMOUNT_PX" to 1px
Got removed from 00170c8e4a due to rebasing and squashing...
2024-12-30 02:19:17 +01:00
schroda
00170c8e4a Properly calculate auto scroll px amount
"scrollBy" and "scrollTo" require a change of at least 1px, otherwise, nothing will happen
2024-12-30 02:13:57 +01:00
schroda
e2dd5ad211 Use animation frames for auto scrolling continuous pagers 2024-12-30 02:13:56 +01:00
schroda
8eae025d8f Use "coerceIn" util function 2024-12-29 23:41:27 +01:00
schroda
06d0f7147a Update auto scroll direction on reader reading direction change 2024-12-29 23:41:25 +01:00
schroda
3238103ca0 Fix "rtl" detection in "useMouseDragScroll"
"isRTL" was set to the direction value instead of correctly to the boolean flag indicating if it is the actual rtl direction value.

This didn't cause any issues because for ltr because for ltr the result of "scrollAtT0.current[X] - delta[X])" was never less than "-maxScrollPos[X]" and for rtl it always used the expected value since "isRTL" was truthy.
2024-12-29 22:14:44 +01:00
schroda
e459e94b71 Properly invert scroll direction in "useAutomaticScrolling" 2024-12-29 22:04:46 +01:00
schroda
732f27f319 Fix "rtl" detection in "useAutomaticScrolling" 2024-12-29 22:04:21 +01:00
schroda
74d9e21c76 Abort auto scroll interval for callback mode 2024-12-29 21:42:00 +01:00
schroda
0e9d758c10 Use correct auto scroll amount for x/y direction 2024-12-27 03:12:19 +01:00
schroda
e2075a651e Add "automatic scrolling" 2024-12-27 03:02:39 +01:00
schroda
33e184ba18 Add "auto webtoon mode" option to reader 2024-12-27 02:51:35 +01:00
schroda
3b62506452 Memoize "useBackButton" returned function 2024-12-25 23:49:17 +01:00
schroda
326e8b9881 Prevent EmptyView from taking over click events
E.g. in the reader it was not possible to open the overlay while the EmptyView was visible due to it blocking the readers click handling
2024-12-24 17:26:46 +01:00
schroda
2acc82289d Add elevation to snackbar
Depending on the color of the background, the snackbar was hard to see, especially when using light mode
2024-12-23 02:46:56 +01:00
schroda
71373d4bd3 Remove unused space at bottom of snackbar without description
Get rid of unnecessary white space when there is no description to show
2024-12-23 02:41:31 +01:00
schroda
f1f660a546 Memoize "withPropsFrom" HOC 2024-12-22 00:48:22 +01:00
schroda
f5642af219 Use HOC for reader context usage 2024-12-22 00:48:18 +01:00
schroda
9e93a78a07 Use "getErrorMessage" everywhere 2024-12-21 23:27:03 +01:00