- Fix BookInfo buttons: Left/Right front = scroll down/up, Confirm = no-op, side buttons retained. Separate Up/Down hints on btn3/btn4. - Fallback load: try epub.load(true, true) when cache-only load fails, so Book Info works for unopened books. - Add "Book Info" to ManageBook menu (BOOK_INFO action) with handlers in all 4 result sites (Home, Recent, FileBrowser, Reader). - Fix HomeActivity cover regen: call generateCoverBmp(false) + validate with isValidThumbnailBmp before falling to placeholder, matching the reader's multi-tier fallback pipeline. Same for XTC branch. Made-with: Cursor
2.9 KiB
2.9 KiB
BookInfo Button Mapping, Fallback Load, ManageBook Integration, Cover Regen Fix
Date: 2026-03-09
Task: Implement fixes 1-5 from the BookInfo Buttons and Load plan
Changes Made
BookInfoActivity.cpp — Fixes 1-3
- Button mapping (
loop()): RemovedConfirmas exit trigger. AddedLeftandRightfront buttons as scroll-down/scroll-up handlers alongside existing side-buttonDown/UpandPageForward/PageBack. - Button hints (
render()): UpdatedmapLabelsto showSTR_DIR_DOWNon Left (btn3) andSTR_DIR_UPon Right (btn4), with separate variables for each direction instead of a single combined hint. - Fallback load (
onEnter()): Changedepub.load(false, true)pattern to tryepub.load(true, true)on failure, ensuring cache is built for books that were never opened. XTC branch already builds unconditionally viaxtc.load().
BookManageMenuActivity — Fix 4
- Added
BOOK_INFOtoActionenum (first entry) - Added
STR_BOOK_INFOmenu item as first entry inbuildMenuItems() - Handled
BOOK_INFOin all 4 result sites:HomeActivity::openManageMenu()— launchesBookInfoActivityviastartActivityForResultRecentBooksActivity::openManageMenu()— same patternFileBrowserActivity::handleManageResult()— same patternEpubReaderActivityinline switch — same pattern
- Added
BOOK_INFOno-op case toexecuteManageAction()in Home/Recent to prevent compiler warnings
HomeActivity cover regeneration — Fix 5
- After
generateThumbBmp()fails or produces invalid BMP, now callsgenerateCoverBmp(false)to extract the full cover from the EPUB before retrying thumbnail generation - Added
Epub::isValidThumbnailBmp()validation after eachgenerateThumbBmp()call - Applied same pattern to XTC branch using
xtc.generateCoverBmp()+ validation - This aligns the HomeActivity pipeline with the EpubReaderActivity's multi-tier fallback approach
Files Changed
src/activities/home/BookInfoActivity.cpp— button mapping, hints, fallback loadsrc/activities/home/BookManageMenuActivity.h— BOOK_INFO enum entrysrc/activities/home/BookManageMenuActivity.cpp— BOOK_INFO menu itemsrc/activities/home/HomeActivity.cpp— BOOK_INFO handler + cover regen fixsrc/activities/home/RecentBooksActivity.cpp— BOOK_INFO handlersrc/activities/home/FileBrowserActivity.cpp— BOOK_INFO handlersrc/activities/reader/EpubReaderActivity.cpp— BOOK_INFO handler
Build Result
Build succeeded — 0 errors, 0 code warnings. RAM: 30.3%, Flash: 95.7%.
Follow-up Items
- Test on device: verify all 4 BookInfo entry points work (Home manage, Recent manage, FileBrowser manage, Reader manage)
- Test cover regeneration after DELETE_CACHE from reader menu
- Verify button mapping on BookInfo screen (Left=down, Right=up, side buttons=scroll)
- Verify Book Info shows for books that have never been opened