Commit graph

250 commits

Author SHA1 Message Date
Moustapha Kodjo Amadou
ca51a38fbd fix #702 2026-04-15 12:53:50 +01:00
Moustapha Kodjo Amadou
feb0a3635f Fix sorting logic for chapters 2026-04-13 10:40:05 +01:00
NBA2K1
81123dc3cb Change the MangasListStateProvider to Set<int>
MangasListState previously stored selected manga IDs as List<int>.
Every visible library card called .contains() on that list once per
rebuild to determine its highlight state, making each check O(n) in
the number of selected items. The provider's own update/selectAll/
selectSome methods also used .contains() and .remove() on a List.

Change the state type to Set<int> throughout, making all membership
checks O(1). Updated all consumers: library_gridview_widget,
library_listview_widget, library_app_bar, library_dialogs, and
MangasSetIsReadState.
2026-04-12 23:03:18 +02:00
NBA2K1
9f113f2956 Optimize downloaded‑chapter filtering
- Precompute downloaded chapter IDs in a single query
- Replace per‑chapter lookups with in‑memory `Set` checks
2026-04-12 23:02:43 +02:00
NBA2K1
547413cad3 return correct List<Chapter> 2026-04-12 23:02:26 +02:00
NBA2K1
1286afb3df change ref.watch to ref.read 2026-04-12 01:56:47 +02:00
NBA2K1
c468de6a16 make code more readable 2026-04-12 01:56:42 +02:00
NBA2K1
7f12e1ae6e cache settings 2026-04-12 01:56:31 +02:00
NBA2K1
b0b48403fd Reduce FilterQuality
reduce FilterQuality during scroll/zoom for smoother rendering
2026-04-12 00:05:02 +02:00
NBA2K1
64a28d822d CropBorders performance+
call `_processCropBorders()` once, from _initCurrentIndex and after new pages arrive.

Also make _processCropBorders idempotent by the existing _cropBorderCheckList guard
2026-04-12 00:04:56 +02:00
NBA2K1
590ce38f29 save last index 2026-04-12 00:04:31 +02:00
NBA2K1
1735c80014 Fix page jumps
fix for the "jump back" bug that occurred when scrolling up in vertical continuous and webtoon reader modes.

- `ChapterPreloadManager` was maintaining its own `_currentIndex`.
- When prepending previous chapter pages, the index was being incremented
  twice (once in the manager + once in `_handlePrevChapterPrepended`).
- This caused `itemScrollController.jumpTo()` to overshoot, resulting in
  a visible jump forward (perceived as "jump back" while trying to scroll up).

- Removed all index management (`_currentIndex`, getter, setter, startIndex)
  from `ChapterPreloadManager` and `ReaderMemoryManagement`.
- `ChapterPreloadManager` is now a pure data container (only manages `_pages`).
- `_handlePrevChapterPrepended` now captures the **current visible top index**
  *before* prepending and adjusts the scroll position only once.
- `_readProgressListener` is now the single source of truth for `_currentIndex`.
- Removed stale `initialScrollIndex` logic from preload initialization.
2026-04-12 00:02:50 +02:00
NBA2K1
5b888fbe43 TODO comment, so we don't forget 2026-04-12 00:02:39 +02:00
NBA2K1
c0443edff4 Fix list rebuild jank by adding stable page keys
Introduce a unique `ValueKey` for each page (chapter ID + page index) and wrap items in `KeyedSubtree`. This ensures Flutter can correctly preserve widget identity when the preload manager inserts or prepends pages.

Previously, every `setState` triggered by page preloading caused the entire list to rebuild, leading to visible lag. With stable keys, only newly added pages rebuild while existing ones retain their state.

This significantly reduces jank, improves scroll smoothness, and makes chapter transitions nearly seamless.
2026-04-12 00:02:31 +02:00
NBA2K1
b972915391 Spelling error 2026-04-12 00:02:24 +02:00
NBA2K1
9e795106f8 Fix page jumps
`ChapterPreloadManager.preloadPrevChapter` does `_currentIndex += prependCount` (internal manager index).
Then `_handlePrevChapterPrepended` in `reader_view.dart` does the exact same thing again to the UI’s `_currentIndex` before calling `jumpTo`.

The UI state already handles the adjustment + `jumpTo` correctly.
The manager’s internal `_currentIndex` is not needed for continuous mode (the `ItemPositionsListener` overrides it anyway).
2026-04-12 00:02:12 +02:00
Moustapha Kodjo Amadou
7c13d15c49
Merge pull request #695 from NBA2K1/gray-screen-fix
Potential fix for gray screen bug on vertical reading mode
2026-04-11 15:11:57 +01:00
NBA2K1
2e5335eed7 Potential fix for gray screen bug on vertical reading mode 2026-04-10 19:55:14 +02:00
NBA2K1
e8e3a4a2d8 make ts readable
Same logic, nothing has changed.
Just more readable.
2026-04-09 17:52:54 +02:00
NBA2K1
271be91ce6 remove default compression level in settings model
because the default is already in the provider, so it is redundant.

+ regenerate provider
2026-04-06 16:04:23 +02:00
NBA2K1
b760e37ff0 Revert "fix(reader): stabilize chapter progress and page cache writes"
This reverts commit 9f6bf93876.
2026-04-04 02:29:42 +02:00
Moustapha Kodjo Amadou
2e102f9db9 Update dependencies, refactor HTTP client handling and fix dart extension header handling 2026-04-03 12:13:11 +01:00
MorningOctober
9f6bf93876 fix(reader): stabilize chapter progress and page cache writes
- prevent stale settings overwrites by reloading settings inside Isar write txn before updating chapterPageUrlsList

- guard getPageLength() against missing chapter entries and empty urls to avoid No element crashes

- simplify read-threshold calculation in setPageIndex() via totalPages/pagesRemaining for continuous and paged modes

- map visible continuous double-page indices to actual page indices in _readProgressListener before persisting progress

- snapshot item positions and clamp indices during fast scrolling to avoid volatile first/last access races
2026-03-28 13:49:39 +01:00
MorningOctober
7fca156df4 fix(reader): restore chapter read-state updates in continuous mode 2026-03-25 10:45:11 +01:00
Moustapha Kodjo Amadou
236a0cfc6d feat: add localization strings for statistics and reading time tracking #672
- Added new localization strings for total, mean per title, completion rate, watching time, reading time, average chapters per title, read percentage, and entries in multiple languages.
- Enhanced the History model to include readingTimeSeconds.
- Updated AnimeStreamController and ReaderController to track reading time and save it to history.
- Implemented reading time tracking in Anime and Novel reader views.
- Introduced statistics calculations for total reading time across histories.
- Updated statistics screen to display total reading time and average reading time per title.
2026-03-23 11:19:04 +01:00
Moustapha Kodjo Amadou
d02d688d1f Fix slider alignment and page jumps in double page mode 2026-03-18 11:50:13 +01:00
Moustapha Kodjo Amadou
d693445cb1 Fix double page index calculation: uniform pairs (1-2, 3-4, 5-6) 2026-03-18 10:13:56 +01:00
Moustapha Kodjo Amadou
f1dfbbaefc Fix #480/#165 #479 #443 #541 #554 #452: reader and download fixes
- #480/#165: Fix double page mode chapter navigation index conversion
- #479: Fix page jump when switching single/double page mode
- #443: Clear zoom cache on page change for swipe-back
- #541: Add shift-click range selection for chapters (desktop)
- #554: Auto-clean orphaned download records, cascade delete
- #452: Add horizontal continuous RTL reader mode
2026-03-18 09:47:41 +01:00
Moustapha Kodjo Amadou
566da0ae06 feat: implement multiple bug fixes and feature requests\n\n- #339: Remember window size/position on desktop (WindowGeometry utility)\n- #256: Add S key shortcut to skip intro in desktop anime player\n- #372: Auto-delete downloaded chapters after reading (new setting + toggle)\n- #402: Fix manhwa reader scroll jumps by caching image dimensions for placeholders\n- #608: Fix 'Fit width' scale type cropping pages in paged reader mode\n- #572: Add mouse back button navigation support on desktop" 2026-03-17 14:31:21 +01:00
Moustapha Kodjo Amadou
0abd706ec8 fix #670 2026-03-17 11:01:12 +01:00
Moustapha Kodjo Amadou
95a55d5f81 feat: Implement upcoming manga calendar feature
- Added UpcomingUIModel for managing upcoming manga list items with headers and items.
- Introduced CalendarDay widget to display individual days with event indicators.
- Created CalendarHeader widget for navigating between months.
- Developed CalendarIndicator for visualizing events on specific days.
- Implemented UpcomingCalendar to manage the calendar view and event loading.
- Added UpcomingItem widget for displaying individual upcoming manga with cover images.
- Introduced FetchInterval utility to calculate fetch intervals based on chapter upload dates.
- Refactored updateMangaDetail to utilize FetchInterval for smart update days.
- Enhanced MedianExtension to ensure correct median calculation.
- Removed unused imports and commented-out code for cleaner implementation.
2026-03-05 12:05:29 +01:00
Moustapha Kodjo Amadou
87028ea8f5 feat(reader): implement bidirectional chapter preloading and enhance memory management 2026-03-04 22:30:55 +01:00
Moustapha Kodjo Amadou
2f0fc85316 feat(reader): add navigation layout options and settings for screen behavior
- Implemented multiple navigation layouts for the reader, including L-shaped, Kindle, Edge, Right & Left, and Disabled modes.
- Added settings for keeping the screen on, showing page gaps, and adjusting webtoon side padding.
- Enhanced the reader settings modal to include new options and improved UI for navigation layout selection.
- Color filters: invert/gray/BCS
2026-03-04 16:04:07 +01:00
Moustapha Kodjo Amadou
1256e608c7 Refactor 2026-03-02 11:49:19 +01:00
Schnitzel5
ac21eae8d4 small adjustments for a better reading experience of many single pages in a row
- to prevent old entries (before sourceId was introduced) from accidentally using conflicting sources with the same name even if they are not installed
2026-01-30 23:15:26 +01:00
Moustapha Kodjo Amadou
74b194602c update dependencies & update riverpod provider declarations 2026-01-08 14:27:08 +01:00
Moustapha Kodjo Amadou
19a051b660 feat: add updatePageCropImage method for chapter page cropping 2025-12-18 17:03:06 +01:00
Moustapha Kodjo Amadou
8fe910900b + 2025-12-14 13:17:47 +01:00
Moustapha Kodjo Amadou
1e469614d9 Chapter jump fix in vertical continuous mode 2025-12-14 13:16:19 +01:00
Moustapha Kodjo Amadou
4e9af30e8e feat(reader): add page indicator, app bar, bottom bar, gesture handler, and settings modal
- PageIndicator widget to display current page and total pages.
- Created ReaderAppBar for navigation and chapter information.
- ReaderBottomBar for page navigation and settings access.
- Added ReaderGestureHandler for managing tap zones and gestures.
- ReaderSettingsModal for user-configurable settings.
2025-12-05 16:54:10 +01:00
Moustapha Kodjo Amadou
57fcb9e1c9 chore: update dependencies 2025-11-28 14:31:39 +01:00
Moustapha Kodjo Amadou
26362fe556 refactor: replace await for loop with listen for message handling 2025-11-25 15:35:29 +01:00
Moustapha Kodjo Amadou
405c3d8e35 fix 2025-11-25 15:34:38 +01:00
Whiskas101
9e9ffb4e79 fix: forgot to make cropBorder provider autoDispose 2025-11-21 14:25:16 +05:30
Whiskas101
18e8abce94 fix: dangling objects, removed old state provider for getPagesNumber 2025-11-20 22:24:27 +05:30
Moustapha Kodjo Amadou
fd615bd44b refactor: streamline archive import process and enhance cover image handling 2025-11-11 13:13:35 +01:00
Moustapha Kodjo Amadou
b8fffca2b3 Refactor an fix 2025-11-09 01:15:27 +01:00
Moustapha Kodjo Amadou
b1b71ea4d3 Improve auto-scroll condition in manga and novel readers 2025-11-08 20:36:28 +01:00
Moustapha Kodjo Amadou
6eda6de614 Refactor auto-scroll handling and improve tap-to-scroll settings in novel reader 2025-11-08 20:32:25 +01:00
Moustapha Kodjo Amadou
af20e084b0 Refactor dependencies and remove unused packages; update Flutter HTML package; add novel reader settings UI 2025-11-08 01:38:29 +01:00