Commit graph

1022 commits

Author SHA1 Message Date
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
Schnitzel5
a2fa5dc42d added mass migration 2026-04-06 01:49:08 +02:00
Moustapha Kodjo Amadou
21bbbdc012
Merge pull request #686 from NBA2K1/main
Revert commits
2026-04-05 22:56:36 +01:00
Moustapha Kodjo Amadou
f2f9bf9dd2
Merge pull request #684 from Schnitzel5/feature/mihon-integration
integrated ApkBridge for desktop
2026-04-05 22:25:20 +01:00
NBA2K1
820b4d468e Add slider to change backup file compression 2026-04-05 19:06:12 +02:00
NBA2K1
debc8e098b Fix small bug 2026-04-05 17:08:08 +02:00
Schnitzel5
ef8a90165e integrated ApkBridge for desktop 2026-04-04 23:05:51 +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
NBA2K1
0a634ab32f Revert "fix(http): align extension requests with WebView cookies and harden Cloudflare detection"
This reverts commit 2c4a4c688b.
2026-04-04 02:29:27 +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
2c4a4c688b fix(http): align extension requests with WebView cookies and harden Cloudflare detection
Problem
- Genz Updates could still return 403/Cloudflare in extension requests even when the same site worked in WebView.
- The extension HTTP path primarily used cached cookies from settings instead of reliably using the current WebView cookie jar.
- Cloudflare challenge detection was too narrow (mostly English markers) and could misclassify localized challenge pages as resolved.

Solution
- Prefer live WebView cookies for outgoing extension HTTP requests, with settings cookies as fallback.
- Sync cookie + user-agent from embedded WebView on onLoadStop in addition to history updates.
- Expand challenge detection with additional multilingual and platform markers.

Implementation Details
- Updated `MCookieManager.interceptRequest` to read cookies from `CookieManager.getCookies()` and use them as the request `Cookie` header when available.
- Added `_syncCookieAndUaFromWebView()` in `MangaWebView` and invoked it from both `onLoadStop` and `onUpdateVisitedHistory` to persist fresh clearance cookies immediately.
- Introduced a centralized `_cloudflareChallengePattern` in `m_client.dart` and reused it in `_containsCloudflareChallengeHtml` and `_isCloudflareChallengePage` for consistent challenge detection.
2026-03-28 18:17:13 +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
6f722f59c6 fix #667 2026-03-17 11:22:28 +01:00
Moustapha Kodjo Amadou
1f4e81e9b3 fix #669 2026-03-17 11:19:55 +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
7944c6f055 - 2026-03-04 22:32:16 +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
f729380223 feat: Implement app lock feature with biometric authentication
- Added AppLockScreen for biometric authentication to unlock the app.
- Introduced security settings screen to enable/disable app lock.
- Integrated local_auth package for biometric authentication support.
- Created security state providers to manage app lock state.
- Updated chapter list tile widget to support dismiss actions for bookmarking and marking chapters as read.
- Enhanced CBZ conversion process to include ComicInfo.xml metadata.
- Added conditional UI elements based on platform capabilities.
- Added Completed & Tracked filter in library
2026-03-04 11:56:49 +01:00
Moustapha Kodjo Amadou
1256e608c7 Refactor 2026-03-02 11:49:19 +01:00
Moustapha Kodjo Amadou
9ac0f191d7
Merge pull request #664 from NBA2K1/main
Improve Kitsu login dialog with autofill, input validation
2026-03-02 10:48:24 +01:00
NBA2K1
743fff3bf2 Fix focus 2026-02-27 15:41:01 +01:00
Moustapha Kodjo Amadou
5ab4214841 - 2026-02-27 15:02:22 +01:00
NBA2K1
6b3c3f7575 disable login if text fields empty
+ do login when hitting enter
2026-02-27 14:42:37 +01:00
Moustapha Kodjo Amadou
5af59bcbaf fix #663 2026-02-27 14:37:36 +01:00
NBA2K1
7bc3338c2a Make login dialog code simpler
- Remove unnecessary email and password state variables
- Rely on TextEditingController values instead of onChanged
- Reset error state on submit
- Dispose controllers after dialog closes
2026-02-27 14:12:18 +01:00
NBA2K1
f85e661c8e Add autofill to kitsu login dialog
- Wrap login fields in AutofillGroup and add proper autofillHints for email, username, and password
- Add keyboard types, textInputAction, and onFieldSubmitted to improve form navigation
- Disable suggestions/autocorrect for password field
- Add TextInput.finishAutofillContext() on successful login
- Improve focus handling and overall form behavior
- Minor UI/structure adjustments for clarity and consistency
2026-02-27 12:18:25 +01:00
Moustapha Kodjo Amadou
7fe77dafde fix: ensure state is updated only when mounted; increase timer duration to 40 seconds 2026-02-23 15:25:54 +01:00
Moustapha Kodjo Amadou
eec96c6258
Merge pull request #644 from NBA2K1/main
Improve extension service lifecycle, isolate robustness, dedupe lists, and UI/lifecycle cleanups
2026-02-13 10:50:32 +01:00
NBA2K1
e5252183aa Revert "+"
This reverts commit 3c2bc096a9.
2026-02-04 20:04:42 +01:00
Moustapha Kodjo Amadou
5727ab497c
Merge pull request #655 from Schnitzel5/feature/update-category-filter
added option to exclude categories from mass update
2026-01-31 14:55:19 +01:00
Schnitzel5
3c2bc096a9 + 2026-01-31 00:16:48 +01:00
Schnitzel5
7c4ad924b1 added option to exclude categories from mass update 2026-01-31 00:14:39 +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
d5aecf66dc Fix #643 2026-01-26 17:28:25 +01:00
Moustapha Kodjo Amadou
bf6949a834 feat: refactor backup function to improve error handling and notification display 2026-01-23 14:44:17 +01:00
Moustapha Kodjo Amadou
b53e869258 feat: add DNS-over-HTTPS (DoH) support (experimental) 2026-01-20 14:38:46 +01:00
NBA2K1
8b1f7fc581 Add service disposal and lifecycle cleanup
This commit improves memory management, reduces redundant interpreter
instantiation, and standardizes service usage patterns.

- Add `dispose()` to `ExtensionService` interface and implement it across
  Dart, JS, LNReader, and Mihon services.
- Replace repeated interpreter creation in `DartExtensionService` with a
  persistent `_interpreter` instance initialized once in the constructor.
- Add disposal logic for JS DOM selector and Cheerio instances to prevent
  memory leaks.
- Introduce `withExtensionService()` helper to ensure services are always
  disposed after use.
- Update call sites across the codebase to use `withExtensionService()`
  or manual try/finally disposal.
- Improve isolate service message handling by extracting `responsePort`
  earlier.
- Ensure safer defaults (e.g., returning empty lists, const lists) when
  service calls fail.
2026-01-13 01:11:19 +01:00
NBA2K1
f4f344ce29 add log buffer and replace direct list mutation
- Introduce _addLog() helper to manage log insertion
- Enforce a maximum log history of 200 entries to prevent unbounded memory growth
- Replace direct _logsNotifier.value.add(event) with safe, immutable-style list update
- Improve log handling consistency and avoid mutating notifier state in place
2026-01-08 22:48:34 +01:00
NBA2K1
8444e308ad Fix Riverpod lifecycle error
By moving provider-dependent init to didChangeDependencies. (dependOnInheritedWidget)
2026-01-08 21:47:51 +01:00
NBA2K1
ee2d42fa4b categories screen clean up 2026-01-08 18:56:23 +01:00
Moustapha Kodjo Amadou
74b194602c update dependencies & update riverpod provider declarations 2026-01-08 14:27:08 +01:00
Moustapha Kodjo Amadou
b9f9a8398f Refactor download management with shared isolate pool and optimize concurrent downloads 2026-01-08 13:01:15 +01:00
Moustapha Kodjo Amadou
9458ae120b fix #637 2026-01-07 13:07:55 +01:00
Moustapha Kodjo Amadou
701a696820 Enhance category management with animation 2026-01-05 12:38:30 +01:00
Moustapha Kodjo Amadou
6b70fff6cc
Merge pull request #638 from 686udjie/main
add a force landscapre mode on mobile
2026-01-05 12:11:33 +01:00
NBA2K1
922582b270 Fix share params to avoid Text file
- avoids extra text file
- simplify RenderBox lookup
2026-01-04 20:25:13 +01:00
686udjie
79ee4b4fc8 add a force landscapre mode on mobile 2026-01-01 19:48:57 +02:00
NBA2K1
c8328fa347 improve performance of helper method
- compare integers instead of Strings
- cache results per day
2025-12-30 02:44:45 +01:00
NBA2K1
a63f0d67bd Extract helper methods
for better readability
2025-12-30 02:41:47 +01:00
NBA2K1
2c92d74a03 Fix invalid selection
Don't show manga calendar if manga is hidden.
2025-12-30 02:04:06 +01:00
NBA2K1
a2a10a799d Hide items in Calendar
When the user has hidden Manga or Anime or Novel, hide the buttons in the calendar.
2025-12-30 01:37:30 +01:00
NBA2K1
ba77c5baea Reduce Code Duplication
And add comments
2025-12-30 01:15:36 +01:00
NBA2K1
4e2d8b0038 Fix category rearrange bug
When rearranging categories in the Manga library, all categories in Anime and Novel were being deleted.
2025-12-30 00:27:49 +01:00
NBA2K1
821cbfa0dd Make function async
_updateCategoriesOrder() is now async
2025-12-29 23:38:17 +01:00
NBA2K1
4fb9f0a9df remove redundant things 2025-12-29 23:20:08 +01:00
NBA2K1
1ac605e30a Use the localized extension 2025-12-29 23:20:08 +01:00
NBA2K1
9efd76581f Group related functions using an extension
- new file item_type_filters.dart for the hiddenItemTypes function.
- reduces code duplication in statistics_screen, categories_screen and base_library_tab_screen
2025-12-29 23:19:31 +01:00
NBA2K1
7664e38cfd Fix "Show extensions" Button
The "Show extensions" Button was not working properly when categories were hidden.
An Exception would throw:
```
_AssertionError ('package:flutter/src/material/tab_controller.dart': Failed assertion: line 202 pos 12: 'value >= 0 && (value < length || length == 0)': is not true.)
```
And jump to the end of the tab list regardless of where you clicked the button.
2025-12-29 05:02:43 +01:00
NBA2K1
42f1dcff92 Reduce Code Duplication
- Extract localizedItemType() from `base_library_tab_screen.dart`
- Add localizedSources() and localizedExtensions() for browse_screen.dart
- Reduce if-statements in statistics_screen.dart
- Reduce if-statements in categories_screen.dart
- Reduce if-statements in browse_screen.dart
2025-12-29 04:59:06 +01:00
NBA2K1
86fb19ecb2 Refactor tabbed screens into base class
Reduce duplication
2025-12-29 03:28:04 +01:00
NBA2K1
bdcd28488e Same with history_screen.dart
- remove hideItems parameter
- Make TabBar and TabBarView cleaner
2025-12-29 01:58:49 +01:00
NBA2K1
30e6d50210 Make TabBar and TabBarView cleaner
Use the _visibleTabTypes list instead of the repeated if-statements.
2025-12-29 01:34:05 +01:00
NBA2K1
66b508d65d Cleanup
- Change _tabList String-list to be a list of ItemType
- Change its name to _visibleTabTypes
- Use that list in getCurrentItemType(), instead of creating a new list
2025-12-29 01:13:26 +01:00
NBA2K1
e463cce61a Make getCurrentItemType() readable
The previous version was just unnecessarily complicated, hard to read.
New version is very easy to read.
2025-12-29 00:38:33 +01:00