Skip to content

Voice, text to speech reader#3105

Merged
feruzm merged 5 commits intodevelopmentfrom
tts
Jan 29, 2026
Merged

Voice, text to speech reader#3105
feruzm merged 5 commits intodevelopmentfrom
tts

Conversation

@feruzm
Copy link
Member

@feruzm feruzm commented Jan 29, 2026

Summary by CodeRabbit

  • New Features

    • Text-to-speech for posts with play/pause/stop controls integrated into the post header
    • "Voice" option added to the post dropdown for quick access
    • TTS settings sheet: choose voice, adjust speed and pitch, and live-test voices
  • Localization

    • Added translations and labels for TTS controls and settings
  • Chores

    • Added speech runtime dependency and corrected actionsheet package URL
    • iOS deployment target updated for compatibility

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 29, 2026

Caution

Review failed

The head commit changed during the review from 92abf80 to b8657c0.

📝 Walkthrough

Walkthrough

This pull request introduces a complete Text-to-Speech (TTS) feature for reading posts aloud. It adds the expo-speech dependency, creates TTS control and settings components, implements text extraction and settings persistence utilities, integrates TTS controls into the post screen and options menu, and provides localized UI strings.

Changes

Cohort / File(s) Summary
Dependencies
package.json
Added expo-speech (^14.0.8) for native TTS functionality.
TTS Components
src/components/textToSpeech/ttsControls.tsx, src/components/textToSpeech/ttsSettingsSheet.tsx
New TTSControls component manages playback state (play/pause/stop) with loading and error feedback; TTSSettingsSheet provides ActionSheet UI for voice, rate, and pitch configuration with live testing and AsyncStorage persistence.
TTS Utilities
src/utils/textToSpeech.ts, src/utils/ttsSettings.ts
Text extraction utility strips HTML/Markdown and normalizes content for TTS; settings utility manages AsyncStorage persistence and provides defaults for voice preferences.
Component Exports & Constants
src/components/index.tsx, src/constants/options/post.ts
Exported TTSControls from component library; added 'voice' to post options array.
TTS Integration
src/screens/post/screen/postScreen.tsx, src/screens/post/styles/postScreen.styles.tsx, src/components/postOptionsModal/container/postOptionsModal.tsx, src/navigation/sheets.tsx
Integrated TTSControls into post header alongside options button; added "voice" dropdown action that opens TTS_SETTINGS sheet; registered TTS_SETTINGS sheet with action-sheet module and updated type definitions.
Localization
src/config/locales/en-US.json
Added English translations for voice option and TTS settings UI (voice, speed, pitch, test button, info text).
Points Feature Refactor
src/containers/pointsContainer.ts, src/providers/queries/pointQueries.ts, src/providers/ecency/ePoint.ts
Migrated points data fetching from legacy endpoints to new SDK query; added transaction grooming, enhanced error handling, and updated getPointsHistory signature to accept optional type filter parameter.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant TTSControls
    participant ttsSettings as Settings<br/>(AsyncStorage)
    participant Speech as Expo.Speech
    
    User->>TTSControls: Tap Play
    activate TTSControls
    TTSControls->>ttsSettings: Load TTS Settings
    activate ttsSettings
    ttsSettings-->>TTSControls: Return Voice/Rate/Pitch
    deactivate ttsSettings
    TTSControls->>TTSControls: Extract Plain Text<br/>from Post
    alt Text Available
        TTSControls->>Speech: Speech.speak(text, settings)
        activate Speech
        Speech-->>TTSControls: onStart Callback
        TTSControls->>TTSControls: Update isPlaying=true
        User->>TTSControls: Tap Pause (or done)
        Speech-->>TTSControls: onDone Callback
        TTSControls->>TTSControls: Update isPlaying=false
        deactivate Speech
    else No Readable Content
        TTSControls->>TTSControls: Log Warning & Hide
    end
    deactivate TTSControls
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Typing, pagination and other fixes #3103: Both modify src/components/postOptionsModal/container/postOptionsModal.tsx; this PR adds the "voice" dropdown action while the related PR refactors options initialization logic.
  • SDK migration #3099: Both update sheet registration and type declarations in src/navigation/sheets.tsx for action-sheet module augmentation.

Poem

🐰 A voice for the posts, now loud and clear,
With settings to tweak, the sound we hear!
From Markdown stripped, the words take flight,
Expo Speech whispers through day and night.
AsyncStorage keeps your preferences near! 🎙️

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Voice, text to speech reader' clearly summarizes the main addition: a text-to-speech feature with voice controls and TTS settings UI components across the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm merged commit 9a8742d into development Jan 29, 2026
5 checks passed
@feruzm feruzm deleted the tts branch January 29, 2026 20:38
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.

1 participant