2.3 KiB
2.3 KiB
Fix Reader Bugs: Covers, Indexing, TOC, Cache Deletion
Date: 2026-03-08
Commit: 022f519 on mod/master-resync
Task Description
Fixed four bugs reported after the upstream sync feature restoration:
- Placeholder cover text rendering — only first letter of each word visible
- Silent indexing indicator — wrong timing (shown on first page, not during actual indexing) and icon positioned above the status bar
- Long-press confirm for TOC — immediately selected the first chapter upon button release
- Book cache deletion from home screen — showed "no open books" and required double confirm press
Changes Made
lib/PlaceholderCover/PlaceholderCoverGenerator.cpp
- Added
#include <EpdFontData.h>forfp4::toPixel() - Fixed
renderGlyph():glyph->advanceXis 12.4 fixed-point, not pixels — was advancing cursor ~16x too far, causing only the first character of each word to be visible - Fixed
getCharAdvance(): same fixed-point conversion needed for space width calculation in word wrapping
src/activities/reader/EpubReaderActivity.cpp
- Removed
silentIndexNextChapterIfNeeded()call fromloop()(line 385) — this blocked the UI before render, preventing the indicator from ever showing. The backup branch only called it fromrender(), after the page was drawn. - Fixed indexing icon Y position: changed
textY - kIndexingIconSize + 2totextY + 2to align within the status bar alongside battery/text - Passed
consumeFirstReleaseflag when creating chapter selection activity from long-press path
src/activities/reader/EpubReaderChapterSelectionActivity.h/.cpp
- Added
ignoreNextConfirmReleasemember andconsumeFirstReleaseconstructor parameter - In
loop(), consumes the first Confirm release when opened via long-press, preventing immediate selection of the first TOC item
src/activities/home/HomeActivity.cpp
- In
openManageMenu()callback: resetignoreNextConfirmRelease = falseto fix double-press bug - Replaced
recentBooks.clear()withloadRecentBooks()to reload remaining books from persistent store after deletion
Follow-up Items
- Test all four fixes on device to verify correct behavior
- Verify placeholder covers render full title/author text at both thumbnail and full-cover sizes