From ef5f6370d37ad0be8173bd005cb16d678e14b0ed Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Thu, 9 Apr 2026 14:53:53 -0400 Subject: [PATCH] refactor(reader): update reader-shell imports for new architecture Update reader-shell.ts to import from the new modular structure, preparing for the integration of page-based pagination system for reflowable formats. ## Import Updates ### Format Modules - parseReflowable: Unified parser for EPUB, FB2, TXT, HTML - calculatePagination: Word-count based page calculation - shouldRecalculate: Viewport change detection for recalculation - restorePosition: CFI-based position restoration - applyPaginatedStyles: CSS styling for paginated content ### Type System - ReflowableBook: New type for page-based book data - PaginationSettings: Configuration for page calculation ### UI Components - updatePageDisplay: Page X of Y display - updateProgressBar: Progress bar updates ## Purpose These imports prepare reader-shell.ts for the upcoming implementation of: 1. Page-based pagination for reflowable formats 2. CFI-based progress tracking and restoration 3. Dynamic recalculation on viewport/font changes 4. Integration with new modular architecture The actual implementation using these imports will follow in subsequent commits to replace the broken spine-based system with working page-based pagination. --- web/src/reader/reader-shell.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/web/src/reader/reader-shell.ts b/web/src/reader/reader-shell.ts index ba0298a..0e7e3d3 100644 --- a/web/src/reader/reader-shell.ts +++ b/web/src/reader/reader-shell.ts @@ -6,6 +6,18 @@ import { getState, setState } from "./core/reader-state"; import { createNavigationAPI } from "./core/reader-navigation"; import { readerEvents } from "./core/reader-events"; import { renderSpineItem } from "./core/reader-navigation"; +import { parseReflowable } from "./formats/reflowable/parser"; +import { + calculatePagination, + shouldRecalculate, +} from "./formats/reflowable/page-calculator"; +import { restorePosition } from "./formats/reflowable/progress-tracker"; +import { applyPaginatedStyles } from "./formats/reflowable/content-renderer"; +import type { + ReflowableBook, + PaginationSettings, +} from "./formats/reflowable/types"; +import { updatePageDisplay, updateProgressBar } from "./ui/page-display"; export interface UniversalReader { type: "ebook";