Commit graph

993 commits

Author SHA1 Message Date
NBA2K1
04e04010f4 Reduce Code Duplication 2026-04-15 22:04:15 +02:00
NBA2K1
63e747fa3e watch -> read 2026-04-15 22:04:09 +02:00
NBA2K1
c2d19fd17d make the list const 2026-04-15 22:04:03 +02:00
NBA2K1
35479187ca Remove unused import 2026-04-15 22:03:54 +02:00
Moustapha Kodjo Amadou
ca51a38fbd fix #702 2026-04-15 12:53:50 +01:00
Moustapha Kodjo Amadou
0576583528 fix: add spacing to TTS settings tab for better layout 2026-04-13 15:15:05 +01:00
Moustapha Kodjo Amadou
dacebb660a
Merge pull request #697 from NBA2K1/performance-improvements
fix page jumps in vertical/webtoon mode + performance improvements in library/reader
2026-04-13 10:55:25 +01:00
Moustapha Kodjo Amadou
feb0a3635f Fix sorting logic for chapters 2026-04-13 10:40:05 +01:00
Moustapha Kodjo Amadou
ee91e3cec7
Merge pull request #696 from NBA2K1/Fix-FileSystemException
Pass sanitized chapterName instead chapter.name
2026-04-13 09:48:45 +01:00
NBA2K1
e33af9cbe6 Update library_screen.dart 2026-04-12 23:03:56 +02:00
NBA2K1
cc05ee13e8 Reduce code duplication
Also, change
`entry.chapters.toList().reversed.toList().last`
to
`entry.chapters.first`
Why reverse the list and then get the last item, when you can just get the first?
2026-04-12 23:03:50 +02:00
NBA2K1
05111da02b Extract ContinueReaderButton 2026-04-12 23:03:44 +02:00
NBA2K1
d706e82fd8 simplify query for continueReaderBtn
Refactor history lookup to use a direct mangaIdEqualTo query instead of the previous multi‑level chapter/manga filter.
The new approach improves performance, readability, and maintainability without changing how the play button behaves or how history entries are resolved.
2026-04-12 23:03:37 +02:00
NBA2K1
3f19636fcf Optimize download check
Change per‑chapter synchronous lookups inside isar.txnSync to a single batched anyOf query using collected chapter IDs.

Reduces repeated filtering, removes unnecessary loop, and improves performance.
2026-04-12 23:03:32 +02:00
NBA2K1
31409bfb3c Use mangaIds
No need to create new `mangaIdsList` variable, because mangaIds is the same
2026-04-12 23:03:23 +02: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
c5c97d712b debounce the search query 2026-04-12 23:03:12 +02:00
NBA2K1
d8ff9fb01d performance+
Change Clip.antiAliasWithSaveLayer to Clip.antiAlias
2026-04-12 23:03:07 +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
37ab11c700 Pass sanitized chapterName instead chapter.name 2026-04-11 14:33:44 +02: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
Moustapha Kodjo Amadou
013ec8ba3b feat: add support check for TTS functionality on non-Linux platforms 2026-04-09 12:45:19 +01:00
Moustapha Kodjo Amadou
ca92c51aaf feat: add Novel TTS #482 #626 2026-04-09 12:17:17 +01:00
Moustapha Kodjo Amadou
98ed091a12 feat: add showNSFW setting and integrate into browsing features 2026-04-07 15:31:11 +01:00
Moustapha Kodjo Amadou
4d1d8c4472 feat: conditionally display custom DNS option based on DoH state 2026-04-07 14:46:04 +01:00
Moustapha Kodjo Amadou
d275120cac refactor 2026-04-07 14:43:39 +01:00
Moustapha Kodjo Amadou
0df04bcfad feat #682 option to split chapter whe importing local epub 2026-04-07 11:55:42 +01:00
Moustapha Kodjo Amadou
f7ec660543
Merge pull request #691 from Schnitzel5/fix/windows
fixed server update on Windows
2026-04-07 10:40:20 +01:00
Moustapha Kodjo Amadou
50cfa2d217
Merge pull request #688 from NBA2K1/backup-compression
Add suggested changes of review from last PR
2026-04-07 10:37:56 +01:00
Schnitzel5
7394d9ed33 fixed server update on Windows
need to stop the java process that was blocking the directory
2026-04-06 22:15:43 +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
e6eb3d4873 Change compression value of hardcoded 6
to the archive package's default value.

Use that in localization.
2026-04-06 15:55:15 +02:00
NBA2K1
f8ab2ddbf3 clamp compression level to avoid illegal values
suggested change 2/6
https://github.com/kodjodevf/mangayomi/pull/685#pullrequestreview-4060508021
2026-04-06 14:59:40 +02:00
NBA2K1
6c7d0a3b15 write backup file directly to storage instead of RAM
suggested change 1/6
https://github.com/kodjodevf/mangayomi/pull/685#pullrequestreview-4060508021
2026-04-06 14:56:20 +02:00
Moustapha Kodjo Amadou
2a44792f66
Merge pull request #685 from NBA2K1/backup-compression
Add ability to change the compression level of the backup file
2026-04-06 12:59:00 +01:00
NBA2K1
23e239d76b Merge remote-tracking branch 'upstream/main' into backup-compression 2026-04-06 03:27:34 +02:00