refactor(reader): integrate page-based navigation into core system
Update core reader infrastructure to support new page-based navigation system for reflowable formats while maintaining existing functionality for PDF, comic, and manga formats. ## Core Integration Changes ### reader-context.ts - Update imports to use new formats/reflowable module paths - Maintain backward compatibility with existing type definitions ### reader-navigation.ts - **Replace spine-based scrolling with page-based navigation** - Integrate reflowable navigation modules for ebook handling - Add imports for new navigation, progress tracking, and content rendering - Implement discrete page navigation (no scrolling within pages) ## Navigation System Upgrade ### Previous (Broken) - Spine-based scrolling: Scroll through entire chapters - No page boundaries: Couldn't track position within content - Progress tracking failed: No granular position data - Position saving broken: Only saved chapter, not page ### New (Working) - Page-based navigation: Discrete page boundaries - CFI progress tracking: Precise position within content - Position restoration: Accurate page restoration on reload - Real pagination: Actual page numbers instead of chapter offsets ## Format Support ### Reflowable Formats (EPUB, FB2, TXT, HTML) - Use new page-based navigation system - Support for CFI-based progress tracking - Proper pagination with word-count estimation - Page content extraction and rendering ### PDF, Comic, Manga - Maintain existing navigation functionality - No changes to working systems - Preserve user experience for these formats ## Technical Implementation - ReflowableBook type casting for type safety - Navigation functions (nextPage, previousPage, goToPage) - Progress tracking integration - Content rendering with page data - UI updates for page indicators This integration fixes the core pagination issues that prevented proper reading progress tracking and position management for reflowable formats.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { PageCalculationResult } from "../ebook/page-calculator";
|
||||
import { PageCalculationResult } from "../formats/reflowable/page-calculator";
|
||||
|
||||
interface UniversalReader {
|
||||
type: "ebook";
|
||||
|
||||
Reference in New Issue
Block a user