feat: BookInfo button mapping, ManageBook integration, cover regen fix

- 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
This commit is contained in:
cottongin
2026-03-09 02:06:25 -04:00
parent 1105919359
commit edf273f1d8
8 changed files with 110 additions and 11 deletions

View File

@@ -7,6 +7,7 @@
#include <algorithm>
#include "../util/ConfirmationActivity.h"
#include "BookInfoActivity.h"
#include "BookManageMenuActivity.h"
#include "MappedInputManager.h"
#include "RecentBooksStore.h"
@@ -51,6 +52,8 @@ void RecentBooksActivity::onExit() {
void RecentBooksActivity::executeManageAction(BookManageMenuActivity::Action action, const std::string& capturedPath) {
bool success = false;
switch (action) {
case BookManageMenuActivity::Action::BOOK_INFO:
return;
case BookManageMenuActivity::Action::ARCHIVE:
success = BookManager::archiveBook(capturedPath);
break;
@@ -92,7 +95,11 @@ void RecentBooksActivity::openManageMenu(const std::string& bookPath) {
const auto& menuResult = std::get<MenuResult>(result.data);
auto action = static_cast<BookManageMenuActivity::Action>(menuResult.action);
if (action == BookManageMenuActivity::Action::DELETE || action == BookManageMenuActivity::Action::ARCHIVE) {
if (action == BookManageMenuActivity::Action::BOOK_INFO) {
startActivityForResult(std::make_unique<BookInfoActivity>(renderer, mappedInput, capturedPath),
[this](const ActivityResult&) { requestUpdate(); });
} else if (action == BookManageMenuActivity::Action::DELETE ||
action == BookManageMenuActivity::Action::ARCHIVE) {
const char* promptKey =
(action == BookManageMenuActivity::Action::DELETE) ? tr(STR_DELETE_BOOK) : tr(STR_ARCHIVE_BOOK);
std::string heading = std::string(promptKey) + "?";