Files
crosspoint-reader-mod/chat-summaries/2026-03-02_21-00-summary.md
cottongin dfbc931c14 mod: Phase 1 - bring forward mod-exclusive files with ActivityManager migration
Brings ~55 mod-exclusive files to the upstream-based mod/master-resync branch:

Activities (migrated to new ActivityManager pattern):
- Clock/Time: SetTimeActivity, SetTimezoneOffsetActivity, NtpSyncActivity
- Dictionary: DictionaryDefinitionActivity, DictionarySuggestionsActivity,
  DictionaryWordSelectActivity, LookedUpWordsActivity
- Bookmark: EpubReaderBookmarkSelectionActivity
- Book management: BookManageMenuActivity, EndOfBookMenuActivity
- OPDS: OpdsServerListActivity, OpdsSettingsActivity
- Utility: DirectoryPickerActivity, NumericStepperActivity

Utilities (unchanged):
- BookManager, BookSettings, BookmarkStore, BootNtpSync
- Dictionary, LookupHistory, TimeSync, OpdsServerStore

Libraries: PlaceholderCover, TableData, ChapterXPathIndexer
Scripts: inject_mod_version, generate_book_icon, preview_placeholder_cover
Docs: KOReader sync XPath mapping

Migration changes:
- ActivityWithSubactivity -> Activity base class
- Callback constructors -> finish()/setResult() pattern
- enterNewActivity() -> startActivityForResult()
- Activity::RenderLock&& -> RenderLock&&

These files won't compile yet - they reference mod settings and I18n
strings that will be added in subsequent phases.

Made-with: Cursor
2026-03-07 15:10:00 -05:00

2.1 KiB

Port Upstream KOReader Sync PRs

Task

Port three unmerged upstream PRs into the fork:

  • PR #1185: Cache KOReader document hash
  • PR #1217: Proper KOReader XPath synchronisation
  • PR #1090: Push progress and sleep (with silent failure adaptation)

Changes Made

PR #1185 — Cache KOReader Document Hash

  • lib/KOReaderSync/KOReaderDocumentId.h: Added private static helpers getCacheFilePath, loadCachedHash, saveCachedHash
  • lib/KOReaderSync/KOReaderDocumentId.cpp: Cache lookup before hash computation, persist after; uses mtime fingerprint + file size for validation

PR #1217 — Proper KOReader XPath Synchronisation

  • lib/KOReaderSync/ChapterXPathIndexer.h/.cpp: New files — Expat-based on-demand XHTML parsing for bidirectional XPath/progress mapping
  • lib/KOReaderSync/ProgressMapper.h/.cpp: XPath-first mapping in both directions, percentage fallback, DocFragment 1-based indexing fix, std::clamp sanitization
  • docs/contributing/koreader-sync-xpath-mapping.md: Design doc

PR #1090 — Push Progress & Sleep (adapted)

Adapted to fork's ActivityWithSubactivity + callback architecture (upstream uses Activity + startActivityForResult).

  • lib/I18n/translations/english.yaml + auto-generated I18nKeys.h: Added STR_PUSH_AND_SLEEP
  • src/activities/reader/EpubReaderMenuActivity.h: Added PUSH_AND_SLEEP to MenuAction enum and buildMenuItems()
  • src/activities/reader/KOReaderSyncActivity.h/.cpp: Added SyncMode::PUSH_ONLY, deferFinish() mechanism, PUSH_ONLY paths in performSync/performUpload/loop
  • src/activities/reader/EpubReaderActivity.h/.cpp: Added pendingSleep flag, extern void enterDeepSleep(), PUSH_AND_SLEEP case in onReaderMenuConfirm

Silent failure: Both onCancel and onSyncComplete callbacks set pendingSleep = true, so the device sleeps regardless of sync success/failure. No credentials also triggers sleep directly.

Build

Compiles cleanly on default environment (ESP32-C3). RAM: 32.8%, Flash: 71.7%.

Follow-up Items

  • Changes are unstaged — commit when ready
  • Other language YAML files will auto-fallback to English for STR_PUSH_AND_SLEEP