# Fresh Replay: Sync mod/master with upstream/master (continued) ## Task Continue the "Fresh Replay" synchronization of mod/master with upstream/master (HEAD: 170cc25). This session picked up from Phase 2c (GfxRenderer/theme modifications) and completed through Phase 4 (verification). ## Changes Made ### Phase 2c-e: GfxRenderer, themes, SleepActivity, SettingsActivity, platformio - Added `drawPixelGray` to GfxRenderer for letterbox fill rendering - Added `PRERENDER_THUMB_HEIGHTS` to UITheme for placeholder cover generation - Added `[env:mod]` build environment to platformio.ini - Implemented sleep screen letterbox fill (solid/dithered) with edge caching in SleepActivity - Added placeholder cover fallback (PlaceholderCoverGenerator) for XTC/TXT/EPUB sleep screens - Added Clock settings category to SettingsActivity with timezone, NTP sync, set-time actions - Replaced CalibreSettingsActivity with OpdsServerListActivity for OPDS server management - Added DynamicEnum rendering support for settings - Added long-press book management to RecentBooksActivity ### Phase 3: Re-port unmerged upstream PRs - **#1055** (byte-level framebuffer writes): fillPhysicalHSpan*, optimized fillRect/drawLine/fillRectDither/fillPolygon - **#1027** (word-width cache): 128-entry FNV-1a cache, hyphenation early exit (7-9% layout speedup) - **#1068** (URL hyphenation): Already present in upstream - **#1019** (file extensions in browser): Already present in upstream - **#1090/#1185/#1217** (KOReader sync): Binary credential store, document hash caching, ChapterXPathIndexer - **#1209** (OPDS multi-server): OpdsBookBrowserActivity accepts OpdsServer, directory picker, download-complete prompt - **#857** (Dictionary): Activities already ported in Phase 1/2 - **#1003** (Placeholder covers): Already integrated in Phase 2 ### Fixes - Added `STR_OFF` i18n string for clock format setting - Fixed include paths (ActivityResult.h from subdirectories) - Replaced `Epub::isValidThumbnailBmp` with `Storage.exists()` (method doesn't exist in upstream) - Replaced `StringUtils::checkFileExtension` with `FsHelpers` equivalents ### Image pipeline decision - Kept upstream's JPEGDEC implementation — mod's picojpeg was a workaround for the older codebase - No mod-specific image pipeline changes needed ## Branch Status - **mod/master-resync**: 6 commits ahead of upstream/master (170cc25) - **mod/backup-pre-sync-2026-03-07**: Safety snapshot of original mod/master - 189 files changed, ~114,566 insertions, ~379 deletions vs upstream ## Follow-up Items - Run full PlatformIO build on hardware to verify compilation - Run clang-format on all modified files - Test on device: clock display, sleep screen letterbox fill, dictionary, OPDS browsing - KOReaderSyncActivity PUSH_ONLY mode (from PR #1090) not yet re-added to activity - Consider adding `StringUtils.h` if other mod code needs `checkFileExtension` - Update mod version string