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.
call `_processCropBorders()` once, from _initCurrentIndex and after new pages arrive.
Also make _processCropBorders idempotent by the existing _cropBorderCheckList guard
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.
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.
`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).
- 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
- 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.
- 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.
- 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
- to prevent old entries (before sourceId was introduced) from accidentally using conflicting sources with the same name even if they are not installed
- 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.