Files
crosspoint-reader-mod/chat-summaries/2026-02-16_19-30-summary.md

58 lines
3.2 KiB
Markdown
Raw Normal View History

# Reader Menu Improvements
## Task
Overhaul the EPUB reader menu: consolidate dictionary actions behind long-press, add portrait/landscape toggle with preferred-orientation settings, add font size cycling, and rename several menu labels.
## Changes Made
### 1. Consolidated Dictionary Menu Items
- Removed "Lookup Word History" and "Delete Dictionary Cache" from the reader menu
- Long-pressing Confirm on "Lookup Word" now opens the Lookup History screen
- "Delete Dictionary Cache" moved to a sentinel entry at the bottom of the Lookup History word list
**Files:** `EpubReaderMenuActivity.h`, `EpubReaderMenuActivity.cpp`, `LookedUpWordsActivity.h`, `LookedUpWordsActivity.cpp`, `EpubReaderActivity.cpp`
### 2. Toggle Portrait/Landscape
- Renamed "Reading Orientation" to "Toggle Portrait/Landscape" in the reader menu (kept the original name in global Settings)
- Short-press now toggles between preferred portrait and preferred landscape orientations
- Long-press opens a popup sub-menu with all 4 orientation options
- Added `preferredPortrait` and `preferredLandscape` settings to `CrossPointSettings` (serialized at end for backward-compat)
- Added corresponding settings to `SettingsList.h` using `DynamicEnum` (maps non-sequential enum values correctly)
**Files:** `CrossPointSettings.h`, `CrossPointSettings.cpp`, `SettingsList.h`, `EpubReaderMenuActivity.h`, `EpubReaderMenuActivity.cpp`
### 3. Toggle Font Size
- Added new `TOGGLE_FONT_SIZE` menu action
- Cycles through Small → Medium → Large → Extra Large → Small on each press
- Shows current size value next to the label (like orientation)
- Applied on menu exit via extended `onBack` callback `(uint8_t orientation, uint8_t fontSize)`
- Added `applyFontSize()` to `EpubReaderActivity` (saves to settings, resets section for re-layout)
**Files:** `EpubReaderMenuActivity.h`, `EpubReaderMenuActivity.cpp`, `EpubReaderActivity.h`, `EpubReaderActivity.cpp`
### 4. Label Renames
- "Letterbox Fill" → "Override Letterbox Fill" (reader menu only; global setting keeps original name)
- "Sync Progress" → "Sync Reading Progress"
**Files:** `english.yaml` (I18n source), regenerated `I18nKeys.h`, `I18nStrings.h`, `I18nStrings.cpp`
### 5. Long-Press Safety
- Added `ignoreNextConfirmRelease` flag to `EpubReaderMenuActivity` to prevent stale releases
- Added `initialSkipRelease` constructor parameter to `LookedUpWordsActivity`
- Extended `ignoreNextConfirmRelease` guard to cover the word-selection path (not just delete-confirm mode)
- Orientation sub-menu also uses `ignoreNextConfirmRelease` to avoid selecting on long-press release
### 6. New I18n Strings
- `STR_TOGGLE_ORIENTATION`: "Toggle Portrait/Landscape"
- `STR_TOGGLE_FONT_SIZE`: "Toggle Font Size"
- `STR_OVERRIDE_LETTERBOX_FILL`: "Override Letterbox Fill"
- `STR_PREFERRED_PORTRAIT`: "Preferred Portrait"
- `STR_PREFERRED_LANDSCAPE`: "Preferred Landscape"
## Build Status
Successfully compiled (default environment). RAM: 31.1%, Flash: 99.4%.
## Follow-up Items
- Translations: New strings fall back to English for all non-English languages. Translators can add entries to their respective YAML files.
- The `SettingInfo::Enum` approach doesn't work for non-sequential enum values (portrait=0, inverted=2). Used `DynamicEnum` with getter/setter lambdas instead.