# Fix Text Wrapping and Spacing for Expanded Selected Row ## Task Improve the expandable selected row feature (from PR #1019 enhancement). Two issues were identified from device testing: 1. Character-level wrapping broke words mid-character (e.g., "Preside / nt"), resulting in unnatural line breaks. 2. Poor vertical spacing -- text lines clustered near the top of the expanded highlight area with large empty space at the bottom. ## Changes Made ### `src/components/themes/BaseTheme.cpp` - Rewrote `wrapTextToLines` with 3-tier break logic: 1. Preferred delimiters: " -- ", " - ", en-dash, em-dash (breaks at last occurrence to maximize line 1) 2. Word boundaries: last space or hyphen that fits 3. Character-level fallback for long unbroken tokens - Extracted `truncateWithEllipsis` helper to reduce duplication - Fixed expanded row rendering: text lines vertically centered in 2x row height area, extension baseline-aligned with last text line ### `src/components/themes/lyra/LyraTheme.cpp` - Same `wrapTextToLines` rewrite and `truncateWithEllipsis` helper - Same vertical centering for expanded row text lines - Icon also vertically centered in expanded area - Extension baseline-aligned with last text line instead of fixed offset ### `mod/prs/MERGED.md` - Updated PR #1019 mod enhancement section to reflect the new wrapping strategy and spacing improvements ## Follow-up Items - Device testing to verify improved wrapping and spacing visually