port: upstream PR #1342 - Book Info screen, richer metadata, safer controls

Ports upstream PR #1342 (feat: Add Book Info screen, richer metadata,
and safer file-browser controls) with mod-specific adaptations:

- Parse and cache series, seriesIndex, description from EPUB OPF
- Bump book.bin cache version to 6 for new metadata fields
- Add BookInfoActivity (new screen) accessible via Right button in FileBrowser
- Add ManageBook menu via Left button in FileBrowser (replaces upstream hidden delete)
- Guard all delete/archive actions with ConfirmationActivity (10 call sites)
- Add inputArmed gating to ConfirmationActivity to prevent accidental confirmation
- Safe deserialization: readString now returns bool with MAX_STRING_LENGTH guard
- Add series field to RecentBooksStore with JSON and binary serialization
- Add i18n keys: STR_BOOK_INFO, STR_AUTHOR, STR_SERIES, STR_FILE_SIZE, etc.

Made-with: Cursor
This commit is contained in:
cottongin
2026-03-09 00:39:32 -04:00
parent 255b98bda0
commit 4cf395aee9
129 changed files with 244823 additions and 248138 deletions

View File

@@ -68,8 +68,7 @@ void EpubReaderMenuActivity::loop() {
// Long-press Confirm on orientation item opens the sub-menu
if (!orientationSubMenuOpen && mappedInput.isPressed(MappedInputManager::Button::Confirm) &&
mappedInput.getHeldTime() >= longPressMs &&
menuItems[selectedIndex].action == MenuAction::TOGGLE_ORIENTATION) {
mappedInput.getHeldTime() >= longPressMs && menuItems[selectedIndex].action == MenuAction::TOGGLE_ORIENTATION) {
orientationSubMenuOpen = true;
ignoreNextConfirmRelease = true;
orientationSubMenuIndex = pendingOrientation;
@@ -146,7 +145,8 @@ void EpubReaderMenuActivity::loop() {
return;
}
setResult(MenuResult{static_cast<int>(selectedAction), pendingOrientation, selectedPageTurnOption, pendingFontSize});
setResult(
MenuResult{static_cast<int>(selectedAction), pendingOrientation, selectedPageTurnOption, pendingFontSize});
finish();
return;
} else if (mappedInput.wasReleased(MappedInputManager::Button::Back)) {
@@ -176,8 +176,7 @@ void EpubReaderMenuActivity::render(RenderLock&&) {
if (orientationSubMenuOpen) {
const char* subTitle = tr(STR_TOGGLE_ORIENTATION);
const int subTitleX =
contentX +
(contentWidth - renderer.getTextWidth(UI_12_FONT_ID, subTitle, EpdFontFamily::BOLD)) / 2;
contentX + (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, subTitle, EpdFontFamily::BOLD)) / 2;
renderer.drawText(UI_12_FONT_ID, subTitleX, 15 + contentY, subTitle, true, EpdFontFamily::BOLD);
constexpr int lineHeight = 35;