# Restore Lost Mod Features Post-Upstream-Sync ## Task Implemented the full plan to restore 8 mod-specific features lost during the upstream sync, organized into 5 phased commits. ## Changes Made ### Phase 0 — Commit Pending Changes (`4627ec9`) - Staged and committed 22 modified files from previous sessions (ADC fix, logging guard, include path fixes, etc.) as a clean baseline. ### Phase 1 — UI Rendering Fixes (`f44657a`) - **Clock display**: Added clock rendering to `BaseTheme::drawHeader()` and `LyraTheme::drawHeader()` supporting OFF/AM-PM/24H formats and Small/Medium/Large sizes. - **Placeholder covers**: Fixed `splitWords()` in `PlaceholderCoverGenerator.cpp` to treat `\n`, `\r`, `\t` as whitespace (not just spaces). Removed `drawBorder()` call since the UI already draws frames around book cards. ### Phase 2 — Reader Menu Restructure (`0493f30`) - **Manage Book submenu**: Replaced 4 individual top-level menu items (Archive, Delete, Reindex, Delete Cache) with single "Manage Book" entry that launches `BookManageMenuActivity`. - **Dictionary submenu**: Created new `DictionaryMenuActivity` and replaced 3 scattered dictionary items with single "Dictionary" entry. - **Long-press TOC**: Added 700ms long-press detection on Confirm button to open Table of Contents directly, bypassing the menu. - Added `STR_DICTIONARY` i18n key and regenerated I18nKeys.h/I18nStrings.h. ### Phase 3 — Settings and Indexing (`22c1892`) - **Letterbox Fill position**: Moved from bottom of settings list to immediately after Sleep Screen Cover Filter. - **Indexing Display setting**: Added to Display section with Popup/Status Bar Text/Status Bar Icon modes. - **Silent indexing**: Restored proactive next-chapter indexing logic and status bar indicator (text or hourglass icon) in `EpubReaderActivity`. ### Phase 4 — Book Preparation (`a5ca15d`) - **Prerender on first open**: Restored the cover/thumbnail prerender block in `EpubReaderActivity::onEnter()` with "Preparing book..." popup and progress bar. - Added `isValidThumbnailBmp()`, `generateInvalidFormatCoverBmp()`, and `generateInvalidFormatThumbBmp()` methods to `Epub` class. ## Files Modified - `src/components/themes/BaseTheme.cpp`, `src/components/themes/lyra/LyraTheme.cpp` — clock display - `lib/PlaceholderCover/PlaceholderCoverGenerator.cpp` — whitespace splitting, border removal - `src/activities/reader/EpubReaderMenuActivity.h/.cpp` — menu restructure - `src/activities/reader/DictionaryMenuActivity.h/.cpp` — new submenu (created) - `src/activities/reader/EpubReaderActivity.h/.cpp` — long-press TOC, MANAGE_BOOK/DICTIONARY handlers, silent indexing, book prerender - `src/SettingsList.h` — settings reordering, indexing display entry - `lib/Epub/Epub.h`, `lib/Epub/Epub.cpp` — BMP validation and fallback generation methods - `lib/I18n/translations/english.yaml`, `lib/I18n/I18nKeys.h`, `lib/I18n/I18nStrings.h` — STR_DICTIONARY key ## Follow-up Items - On-device verification of all 8 features by user - Optional: verify `pio run -e default` still builds cleanly