Skip to content

feat: message font zoom via text size dialog in conversation view#505

Merged
torlando-tech merged 4 commits intotorlando-tech:mainfrom
MatthieuTexier:feature/message-font-zoom
Feb 21, 2026
Merged

feat: message font zoom via text size dialog in conversation view#505
torlando-tech merged 4 commits intotorlando-tech:mainfrom
MatthieuTexier:feature/message-font-zoom

Conversation

@MatthieuTexier
Copy link
Copy Markdown
Contributor

Summary

Add a text size adjustment feature in the conversation view, accessible via an overflow menu (⋮) in the TopAppBar.

Changes

SettingsRepository

  • Add MESSAGE_FONT_SCALE preference key (DataStore float)
  • Add messageFontScaleFlow (Flow, default 1.0f)
  • Add saveMessageFontScale() with range clamping (0.7f–2.0f)

MessagingViewModel

  • Expose messageFontScale: StateFlow<Float> from SettingsRepository
  • Add saveMessageFontScale(scale) action

MessagingScreen

  • Add overflow menu (⋮) with "Text size" option in conversation TopAppBar
  • Add TextSizeDialog composable with:
    • Slider (70%–200%, 13 steps)
    • Live preview text
    • Percentage label
    • Reset button (back to 100%)
    • OK to confirm
  • Pass fontScale through MessageBubbleLinkifiedMessageText
  • Scale bodyLarge.fontSize by the font scale factor

Tests

  • Add messageFontScaleFlow mock to MessagingViewModelTest (main + failing setup)
  • Add messageFontScaleFlow mock to MessagingViewModelImageLoadingTest
  • Add messageFontScale mock to MessagingScreenTest

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Feb 19, 2026

Greptile Summary

Added text size adjustment feature accessible via overflow menu in conversation view. Users can scale message text from 70% to 200% with a slider dialog that includes live preview and reset functionality. The font scale is persisted in DataStore and flows reactively through the ViewModel to the UI layer.

  • Added MESSAGE_FONT_SCALE preference with proper range clamping (0.7f-2.0f)
  • Implemented TextSizeDialog composable with slider, live preview, and reset button
  • Applied font scaling to LinkifiedMessageText by multiplying bodyLarge.fontSize by the scale factor
  • Updated all test files with appropriate mocks for the new flow

The implementation follows proper Jetpack Compose patterns with StateFlow lifecycle management and reactive UI updates. The slider has 13 steps (12 intermediate + 2 endpoints) covering the full range smoothly.

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • Well-structured feature implementation with proper state management, range validation, test coverage, and clean separation of concerns across repository, ViewModel, and UI layers
  • No files require special attention

Important Files Changed

Filename Overview
app/src/main/java/com/lxmf/messenger/repository/SettingsRepository.kt Added MESSAGE_FONT_SCALE preference key, flow, and save function with proper 0.7f-2.0f range clamping
app/src/main/java/com/lxmf/messenger/viewmodel/MessagingViewModel.kt Exposed messageFontScale StateFlow and saveMessageFontScale() function with proper lifecycle scoping
app/src/main/java/com/lxmf/messenger/ui/screens/MessagingScreen.kt Added overflow menu with text size option, implemented TextSizeDialog with slider and preview, applied font scaling to LinkifiedMessageText

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User taps ⋮ menu] --> B[Opens overflow menu]
    B --> C[User selects 'Text size']
    C --> D[TextSizeDialog opens]
    D --> E[User adjusts slider 0.7-2.0]
    E --> F[Preview updates in real-time]
    F --> G{User action?}
    G -->|OK| H[viewModel.saveMessageFontScale]
    G -->|Reset| I[Set scale to 1.0f]
    H --> J[SettingsRepository.saveMessageFontScale]
    I --> J
    J --> K[DataStore persists scale value]
    K --> L[messageFontScaleFlow emits new value]
    L --> M[MessagingViewModel.messageFontScale updates]
    M --> N[MessagingScreen observes via collectAsStateWithLifecycle]
    N --> O[MessageBubble receives fontScale]
    O --> P[LinkifiedMessageText applies scale]
    P --> Q[Text fontSize = bodyLarge.fontSize × fontScale]
Loading

Last reviewed commit: 46ade88

@sentry
Copy link
Copy Markdown
Contributor

sentry bot commented Feb 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MatthieuTexier MatthieuTexier force-pushed the feature/message-font-zoom branch from 3411037 to d72d9b9 Compare February 19, 2026 19:39
MatthieuTexier and others added 4 commits February 21, 2026 12:52
Add a text size adjustment feature accessible from an overflow menu (⋮)
in the conversation TopAppBar.

- Add MESSAGE_FONT_SCALE preference to SettingsRepository (DataStore)
- Expose messageFontScale StateFlow in MessagingViewModel
- Add overflow menu with "Text size" option (FormatSize icon)
- Create TextSizeDialog with slider (70%-200%), live preview, and reset
- Pass fontScale through MessageBubble → LinkifiedMessageText
- Scale message text fontSize (range 0.7x to 2.0x, persisted)
- Add messageFontScale mocks to ViewModel and UI tests
- Cancel closes the dialog without saving (same as back/tap outside)
- OK saves the current slider value and closes
- Remove Reset button for cleaner UX
Toolbar now shows 4 icons (Call, Location, Star, More) instead of 5.
Sync is accessible via the overflow menu as "Sync messages" with syncing
state indicator (spinner + tinted overflow icon).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace suppress annotation with real assertions: verify menu item
exists before click and menu dismisses after click.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@torlando-tech torlando-tech force-pushed the feature/message-font-zoom branch from d72d9b9 to 08e469f Compare February 21, 2026 21:48
@torlando-tech torlando-tech merged commit c4de03c into torlando-tech:main Feb 21, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants