Skip to content

Split hold-to-record hint based on audioRecordingSendOnComplete#6345

Merged
VelikovPetar merged 1 commit intov7from
feature/update_hold_to_record_hints
Apr 9, 2026
Merged

Split hold-to-record hint based on audioRecordingSendOnComplete#6345
VelikovPetar merged 1 commit intov7from
feature/update_hold_to_record_hints

Conversation

@VelikovPetar
Copy link
Copy Markdown
Contributor

@VelikovPetar VelikovPetar commented Apr 8, 2026

Goal

Distinguish between two recording modes in the hold-to-record hint text. When audioRecordingSendOnComplete is true, the hint says "Hold to record. Release to send." When false (default), it says "Hold to record. Release to save."

Implementation

  • Compose module: Split stream_compose_audio_recording_hint into _hint_send and _hint_save. rememberRecordingHint() picks the correct one based on ChatTheme.config.composer.audioRecordingSendOnComplete.
  • UI Components module: Split stream_ui_message_composer_hold_to_record into _hold_to_record_send and _hold_to_record_save. MessageComposerViewStyle.audioRecordingHoldToRecordText changed from String to String?null (default) resolves the text from string resources based on audioRecordingSendOnComplete; non-null acts as a customer override.
  • Updated Spanish translations, layout XML fallback, styles.xml default, and docs sample.

Testing

  • Set audioRecordingSendOnComplete = true → tap (don't hold) mic button → hint says "Hold to record. Release to send."
  • Set audioRecordingSendOnComplete = false (default) → tap mic button → hint says "Hold to record. Release to save."
  • Set custom audioRecordingHoldToRecordText via StyleTransformer → verify custom text is shown regardless of the flag.

Summary by CodeRabbit

  • New Features
    • Audio recording prompts now provide context-specific guidance with different text displayed based on whether audio will be sent or saved upon release
    • Localization support updated across multiple languages to reflect recording action context

Co-Authored-By: Claude <noreply@anthropic.com>
@VelikovPetar VelikovPetar added the pr:improvement Improvement label Apr 8, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

PR checklist ✅

All required conditions are satisfied:

  • Title length is OK (or ignored by label).
  • At least one pr: label exists.
  • Sections ### Goal, ### Implementation, and ### Testing are filled.

🎉 Great job! This PR is ready for review.

@VelikovPetar VelikovPetar added pr:breaking-change Breaking change and removed pr:improvement Improvement labels Apr 8, 2026
@VelikovPetar VelikovPetar marked this pull request as ready for review April 8, 2026 20:10
@VelikovPetar VelikovPetar requested a review from a team as a code owner April 8, 2026 20:10
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.82 MB 0.57 MB 🔴
stream-chat-android-ui-components 10.60 MB 10.96 MB 0.36 MB 🟡
stream-chat-android-compose 12.81 MB 12.25 MB -0.56 MB 🚀

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Walkthrough

The changes implement conditional audio recording UI text selection based on the audioRecordingSendOnComplete configuration flag. When enabled, the UI displays "release to send"; otherwise it displays "release to save". This includes logic updates, string resource variants, nullable property changes, and documentation adjustments across the compose and UI component modules.

Changes

Cohort / File(s) Summary
Compose Audio Recording
AudioRecordingButton.kt, compose/.../strings.xml
Added conditional hint text selection based on ChatTheme.config.composer.audioRecordingSendOnComplete. Split single hint string into two variants: stream_compose_audio_recording_hint_send and stream_compose_audio_recording_hint_save.
UI Components Message Composer Configuration
MessageComposerViewStyle.kt, DefaultMessageComposerOverlappingContent.kt
Made audioRecordingHoldToRecordText property nullable (String?), enabling dynamic fallback to localized strings based on configuration. Updated display logic to conditionally select between "send" and "save" text variants.
UI Layout & Styles
stream_ui_message_composer_default_center_overlap_floating_hold.xml, styles.xml
Updated layout text reference to stream_ui_message_composer_hold_to_record_save. Removed streamUiMessageComposerAudioRecordingHoldToRecord style attribute definition to allow runtime text resolution.
String Resources
ui-components/.../values/strings.xml, ui-components/.../values-es/strings.xml
Replaced single stream_ui_message_composer_hold_to_record string with two variants: stream_ui_message_composer_hold_to_record_send ("Release to send") and stream_ui_message_composer_hold_to_record_save ("Release to save") in both English and Spanish.
Documentation
AddingRecordingSupport.kt
Updated example guide string resource reference from stream_ui_message_composer_hold_to_record to stream_ui_message_composer_hold_to_record_save.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A rabbit's delight in changes so neat,

Where "send" and "save" now both compete!

Null strings spring forth with config's refrain,

Recording prompts dance through compose and UI plain,

Locales now speak in two voices clear! 🎤

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: splitting the hold-to-record hint text based on the audioRecordingSendOnComplete configuration flag.
Description check ✅ Passed The description covers Goal, Implementation, and Testing sections with clear details. However, it's missing UI Changes (before/after screenshots/videos), Contributor Checklist, and Reviewer Checklist sections from the template.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/update_hold_to_record_hints

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 77a4a20 and 132d7be.

📒 Files selected for processing (9)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/AudioRecordingButton.kt
  • stream-chat-android-compose/src/main/res/values/strings.xml
  • stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/ui/guides/AddingRecordingSupport.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/MessageComposerViewStyle.kt
  • stream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/composer/content/DefaultMessageComposerOverlappingContent.kt
  • stream-chat-android-ui-components/src/main/res/layout/stream_ui_message_composer_default_center_overlap_floating_hold.xml
  • stream-chat-android-ui-components/src/main/res/values-es/strings.xml
  • stream-chat-android-ui-components/src/main/res/values/strings.xml
  • stream-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

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 9, 2026

@VelikovPetar VelikovPetar merged commit d2cd803 into v7 Apr 9, 2026
23 of 26 checks passed
@VelikovPetar VelikovPetar deleted the feature/update_hold_to_record_hints branch April 9, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:breaking-change Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants