Split hold-to-record hint based on audioRecordingSendOnComplete#6345
Split hold-to-record hint based on audioRecordingSendOnComplete#6345VelikovPetar merged 1 commit intov7from
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughThe changes implement conditional audio recording UI text selection based on the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/ui/guides/AddingRecordingSupport.kt`:
- Around line 20-23: The sample hardcodes "save" by overriding
audioRecordingHoldToRecordText in
TransformStyle.messageComposerStyleTransformer, which prevents the SDK from
showing the correct "send" vs "save" copy; instead, remove the hardcoded
override or set audioRecordingHoldToRecordText based on the existing style flag
(defaultStyle.audioRecordingSendOnComplete) or simply preserve
defaultStyle.audioRecordingHoldToRecordText so the built-in send/save selection
remains intact; locate the StyleTransformer assignment
(TransformStyle.messageComposerStyleTransformer and the defaultStyle.copy call)
and either omit the
audioRecordingHoldToRecordText/audioRecordingHoldToRecordTextStyle overrides or
conditionally choose the string from resources based on
defaultStyle.audioRecordingSendOnComplete.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 6cae9b93-51d3-4e58-b484-7f3c71ce4e65
📒 Files selected for processing (9)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/AudioRecordingButton.ktstream-chat-android-compose/src/main/res/values/strings.xmlstream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/ui/guides/AddingRecordingSupport.ktstream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle.ktstream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.ktstream-chat-android-ui-components/src/main/res/layout/stream_ui_message_composer_default_center_overlap_floating_hold.xmlstream-chat-android-ui-components/src/main/res/values-es/strings.xmlstream-chat-android-ui-components/src/main/res/values/strings.xmlstream-chat-android-ui-components/src/main/res/values/styles.xml
💤 Files with no reviewable changes (1)
- stream-chat-android-ui-components/src/main/res/values/styles.xml
...droid-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/ui/guides/AddingRecordingSupport.kt
Show resolved
Hide resolved
|



Goal
Distinguish between two recording modes in the hold-to-record hint text. When
audioRecordingSendOnCompleteistrue, the hint says "Hold to record. Release to send." Whenfalse(default), it says "Hold to record. Release to save."Implementation
stream_compose_audio_recording_hintinto_hint_sendand_hint_save.rememberRecordingHint()picks the correct one based onChatTheme.config.composer.audioRecordingSendOnComplete.stream_ui_message_composer_hold_to_recordinto_hold_to_record_sendand_hold_to_record_save.MessageComposerViewStyle.audioRecordingHoldToRecordTextchanged fromStringtoString?—null(default) resolves the text from string resources based onaudioRecordingSendOnComplete; non-null acts as a customer override.Testing
audioRecordingSendOnComplete = true→ tap (don't hold) mic button → hint says "Hold to record. Release to send."audioRecordingSendOnComplete = false(default) → tap mic button → hint says "Hold to record. Release to save."audioRecordingHoldToRecordTextviaStyleTransformer→ verify custom text is shown regardless of the flag.Summary by CodeRabbit