Files
crosspoint-reader-mod/chat-summaries/2026-02-26_12-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

29 lines
1.7 KiB
Markdown

# Boot NTP Auto-Sync Feature
## Task
Add a "Auto Sync on Boot" toggle in Clock Settings that silently syncs time via WiFi/NTP during boot, with no user interaction required and graceful failure handling.
## Changes Made
### New files
- `src/util/BootNtpSync.h` / `src/util/BootNtpSync.cpp` -- Background FreeRTOS task that scans WiFi, connects to a saved network, runs NTP sync, then tears down WiFi. Provides `start()`, `cancel()`, and `isRunning()` API.
### Modified files
- `src/CrossPointSettings.h` -- Added `uint8_t autoNtpSync = 0` field
- `src/CrossPointSettings.cpp` -- Added persistence (write/read) for the new field
- `src/SettingsList.h` -- Added Toggle entry under Clock category
- `lib/I18n/translations/*.yaml` (all 9 languages) -- Added `STR_AUTO_NTP_SYNC` string
- `lib/I18n/I18nKeys.h` / `lib/I18n/I18nStrings.cpp` -- Regenerated via `gen_i18n.py`
- `src/main.cpp` -- Calls `BootNtpSync::start()` during setup (non-blocking)
- `src/activities/settings/NtpSyncActivity.cpp` -- Added `BootNtpSync::cancel()` guard
- `src/activities/network/WifiSelectionActivity.cpp` -- Added cancel guard
- `src/activities/settings/OtaUpdateActivity.cpp` -- Added cancel guard
- `src/activities/settings/KOReaderAuthActivity.cpp` -- Added cancel guard
- `src/activities/reader/KOReaderSyncActivity.cpp` -- Added cancel guard
- `src/activities/network/CrossPointWebServerActivity.cpp` -- Added cancel guard
## Follow-up Items
- Translations: all non-English languages currently use English fallback for the new string
- The FreeRTOS task uses 4096 bytes of stack; monitor for stack overflow if WiFi scan behavior changes
- WiFi adds ~50-60KB RAM pressure during the sync window (temporary)