Files
crosspoint-reader-mod/chat-summaries/2026-02-20_16-52-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

1.8 KiB

Expandable Selected Row for Long Filenames

Task

Implement a mod enhancement to PR #1019 (Display file extensions in File Browser). When the selected row's filename is too long, expand that row to 2 lines with character-level text wrapping. The file extension moves to the bottom-right of the expanded area. Non-selected rows retain single-line truncation behavior.

Changes Made

src/components/themes/BaseTheme.cpp

  • Added wrapTextToLines static helper in the anonymous namespace: character-level UTF-8-aware text wrapping with "..." truncation on the final line.
  • Modified drawList: pre-loop expansion detection for the selected item, pagination adjustment (pageItems - 1), expanded selection highlight (2 * rowHeight), 2-line title rendering via wrapTextToLines, extension repositioned to bottom-right of expanded area, yPos tracking for subsequent items.

src/components/themes/lyra/LyraTheme.cpp

  • Added identical wrapTextToLines helper.
  • Modified drawList with analogous expansion logic, adapted for Lyra-specific styling (rounded-rect selection highlight, icon support, scroll bar-aware content width, preliminary text width computation for expansion check).

mod/prs/MERGED.md

  • Updated PR #1019 section to document the mod enhancement, files modified, and design decisions.

Follow-up Items

  • Visual testing on device to verify text positioning and edge cases (very long single-word filenames, last item on page expanding, single-item lists).
  • The page-up/page-down navigation in MyLibraryActivity::loop() uses the base pageItems from getNumberOfItemsPerPage which doesn't account for expansion. This causes a minor cosmetic mismatch (page jump size differs by 1 from visual page when expansion is active) but is functionally correct.