refactor(reader): add supporting changes for pagination system

Supporting updates for the new page-based pagination architecture:

settings-manager.ts:
- Export loadSettings function for use in reader initialization
- Allow external modules to access user reading preferences

gestures.ts:
- Update import paths for panel detection modules
- Reflect new format-specific directory structure

types/reader.d.ts:
- Add saved_progress field to ReaderMetadata interface
- Include current_page, cfi, and progress fields
- Enable type-safe access to restored reading position

These changes enable the pagination system to access user
settings and properly type restored progress data.
This commit is contained in:
2026-04-09 21:17:17 -04:00
parent afc41642ba
commit bd94d302ae
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ export function init(context: ReaderContext): void {
});
}
async function loadSettings(): Promise<ReaderSettings> {
export async function loadSettings(): Promise<ReaderSettings> {
const token = getToken();
if (!token) {
const local = localStorage.getItem(LOCALSTORAGE_KEY);
+2 -2
View File
@@ -1,5 +1,5 @@
import type { Panel } from "../comic/panel-detector";
import { detectPanels } from "../comic/panel-detection.service";
import type { Panel } from "../formats/comic/panel-detector";
import { detectPanels } from "../formats/comic/panel-detection.service";
import type { ReaderContext } from "../core/reader-context";
let currentPanelIndex = 0;
+5
View File
@@ -84,6 +84,11 @@ interface ReaderMetadata {
file_path: string;
chapter_metadata?: ChapterMetadata;
total_pages?: number;
saved_progress?: {
current_page?: number;
cfi?: string;
progress?: number;
};
}
// ============================================================