diff --git a/chat-summaries/2026-03-07_21-00-summary.md b/chat-summaries/2026-03-07_21-00-summary.md new file mode 100644 index 00000000..db2468e0 --- /dev/null +++ b/chat-summaries/2026-03-07_21-00-summary.md @@ -0,0 +1,23 @@ +# Fix mod build environment compilation errors + +## Task +Fix compilation errors in the `mod` PlatformIO build environment after the upstream resync. The `default` environment was also verified. + +## Changes Made + +### Include path fixes (11 files) +- `src/activities/{reader,settings,util}/*.cpp`: Changed bare `#include "ActivityResult.h"` to `#include "activities/ActivityResult.h"` (10 files) +- `src/activities/reader/DictionarySuggestionsActivity.cpp`: Changed `#include "RenderLock.h"` to `#include "activities/RenderLock.h"` + +### API compatibility fixes +- `src/util/Dictionary.h`: Replaced invalid `class FsFile;` forward declaration with `#include ` (`FsFile` is now a `using` alias) +- `lib/Epub/Epub/blocks/TextBlock.h`: Added `getWordXpos()` public accessor +- `lib/GfxRenderer/GfxRenderer.{h,cpp}`: Re-added `drawTextRotated90CCW()` with `Rotated90CCW` enum value and coordinate mapping, adapted to new fixed-point rendering +- `src/activities/reader/{DictionarySuggestionsActivity,DictionaryWordSelectActivity,LookedUpWordsActivity}.cpp`: Fixed `setResult()` rvalue ref binding (6 lambdas) +- `src/activities/reader/EpubReaderActivity.cpp`: Fixed `std::max(uint8_t, int)` type mismatch +- `src/util/StringUtils.{h,cpp}`: Re-added `checkFileExtension()` and `sortFileList()` functions +- `src/RecentBooksStore.{h,cpp}`: Added missing `removeBook()` method + +## Follow-up +- Both `mod` and `default` environments build successfully at 95.2% flash usage +- No functional testing performed yet (on-device verification needed) diff --git a/chat-summaries/2026-03-08_00-30-summary.md b/chat-summaries/2026-03-08_00-30-summary.md new file mode 100644 index 00000000..fe5420e3 --- /dev/null +++ b/chat-summaries/2026-03-08_00-30-summary.md @@ -0,0 +1,42 @@ +# 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 diff --git a/chat-summaries/2026-03-08_02-00-summary.md b/chat-summaries/2026-03-08_02-00-summary.md new file mode 100644 index 00000000..1f1f19c4 --- /dev/null +++ b/chat-summaries/2026-03-08_02-00-summary.md @@ -0,0 +1,38 @@ +# 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: + +1. **Placeholder cover text rendering** — only first letter of each word visible +2. **Silent indexing indicator** — wrong timing (shown on first page, not during actual indexing) and icon positioned above the status bar +3. **Long-press confirm for TOC** — immediately selected the first chapter upon button release +4. **Book cache deletion from home screen** — showed "no open books" and required double confirm press + +## Changes Made + +### lib/PlaceholderCover/PlaceholderCoverGenerator.cpp +- Added `#include ` for `fp4::toPixel()` +- Fixed `renderGlyph()`: `glyph->advanceX` is 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 from `loop()` (line 385) — this blocked the UI before render, preventing the indicator from ever showing. The backup branch only called it from `render()`, after the page was drawn. +- Fixed indexing icon Y position: changed `textY - kIndexingIconSize + 2` to `textY + 2` to align within the status bar alongside battery/text +- Passed `consumeFirstRelease` flag when creating chapter selection activity from long-press path + +### src/activities/reader/EpubReaderChapterSelectionActivity.h/.cpp +- Added `ignoreNextConfirmRelease` member and `consumeFirstRelease` constructor 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: reset `ignoreNextConfirmRelease = false` to fix double-press bug +- Replaced `recentBooks.clear()` with `loadRecentBooks()` 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