feat(reader): send richer progress payload with chapter boundaries and zoom
The reader's saveProgress() now sends a more complete payload to the backend so ProgressService has more data for enrichment and merge: - chapter: computed from TOC boundary index instead of missing - reading_mode: current display mode (page, chapter, percent, time-left) - zoom_level: for fixed-layout books (renderer.zoomPercent / 100) - current_page: real page number for fixed-layout, location.current for reflowable - total_pages: section count for fixed-layout, location.total for reflowable Adds computeChapterPageBoundaries(doc) for reflowable EPUBs that maps TOC anchors to rendered page numbers, recomputes after fonts load. Adds computeFixedLayoutChapterBoundaries() for fixed-layout books that resolves TOC hrefs to page indices via view.resolveNavigation(). Updates reader.templ to expose isFixedLayout to Alpine init.
This commit is contained in:
@@ -154,7 +154,7 @@ templ ReaderChrome(user User, metadata ReaderMetadata, progress ReadingProgress)
|
||||
<!-- Separator -->
|
||||
<div class="w-px h-6 bg-gray-600 mx-1"></div>
|
||||
<!-- Progress display -->
|
||||
<div id="progress-display" x-text="progressText" @click="cycleProgressMode()" title="Click to change progress mode" class="text-sm min-w-[4rem] text-center cursor-pointer">
|
||||
<div id="progress-display" x-text="progressText" @click="cycleProgressMode()" :title="progressTooltip()" class="text-sm min-w-[4rem] text-center cursor-pointer">
|
||||
if progress.FormatGroup == "reflowable" {
|
||||
if metadata.EstimatedPages > 0 {
|
||||
{ fmt.Sprintf("%.0f%% · Page %d/%d", progress.Percentage, progress.CurrentPage, metadata.EstimatedPages) }
|
||||
|
||||
Reference in New Issue
Block a user