Merge branch 'close_book_navigation'

This commit is contained in:
Agel committed 2026-11-19 11:54:13 +01:00
commit 6445c23fae
12 files changed
+300 -46

No files matched your search

+2 -1
View File
@@ -277,7 +277,7 @@ public:
## Position Restoration & State Persistence
- **History Persistence & Ordering**: `AppState` persists the history list. On deserialization (`HistoryModel::load`), timestamps are converted to strongly-typed `QDateTime`, and bogus or unparseable timestamps are immediately dropped. Loaded entries are sorted in descending chronological order (`lastOpened desc`). Runtime updates (`addOrUpdateBook`) preserve this descending chronological order without inversions.
- **Position Persistence**: `BookPositionStore` persists `BookPosition` (`chunkIndex`, `intraOffset`, `progress`, `pageShift`, `mangaRTL`, `useBookColours`) indexed by file content MD5 (`contentHash()`), ensuring state survives file renames or moves.
- **UI State Persistence**: `UiState` persists `themeName`, `lastPage`, `sidebarOpen`, `barsVisible`, `lastFilePath`, `customTheme`, and window geometry. Distraction-free chrome toggling via spacebar toggles `barsVisible` without destroying the persistent `sidebarOpen` user preference; effective sidebar visibility in reader mode is gated by `(!inReader || barsVisible) && uiState.sidebarOpen`.
- **UI State Persistence**: `UiState` persists `themeName`, `lastPage`, `sidebarOpen`, `barsVisible`, `lastFilePath`, `customTheme`, and window geometry. Distraction-free chrome toggling via spacebar toggles `barsVisible` without destroying the persistent `sidebarOpen` user preference; effective sidebar visibility in reader mode is gated by `(!inReader || barsVisible) && uiState.sidebarOpen`. Navigating away from the reader to `History` or `Custom Theme` (or opening a new file) closes the active/loading book via `Book.close()` (cancelling in-flight loads, snapshotting progress into `HistoryModel`, resetting `ReadingModel`, and clearing `UiState.lastFilePath`), while opening the `Settings` popup keeps the current book open.
- **Restoration Flow**:
- Text mode: `ReadingModel` computes layout for the saved anchor chunk first, then emits `restoreReady(chunkIndex, intraOffset)`. `ScrollPageView` positions the `ListView` at `chunkIndex` and applies `intraOffset`.
- Comic mode: `restoreReady(chunkIndex)` triggers `MangaPageView.showPair(pairIndexForChunk(chunkIndex))`.
@@ -389,6 +389,7 @@ src/
specs/
knuth-plass-rendering.allium
tests/
AppCoordinatorTest.cpp
AppStateTest.cpp
EntryImageProviderTest.cpp
FileIconProviderTest.cpp