Skip to content

Fix recording toast spacing above fixed-style composer#6482

Merged
andremion merged 2 commits into
developfrom
and-1210-voice-message-recording-toast-spacing-above-the-composer
Jun 1, 2026
Merged

Fix recording toast spacing above fixed-style composer#6482
andremion merged 2 commits into
developfrom
and-1210-voice-message-recording-toast-spacing-above-the-composer

Conversation

@andremion
Copy link
Copy Markdown
Contributor

@andremion andremion commented Jun 1, 2026

Goal

The voice-message recording hint toast ("Hold to record. Release to save/send") should sit 16px above the composer top edge, per design. It does in the floating composer style, but in the default fixed style the gap collapses to ~0px. The same gap is missing on the mic-permission rationale snackbar, which shares the component.

Resolves AND-1210 (Notion #12).

Implementation

The toast is a popup anchored to the record button, which sits 16dp inside the fixed-style composer (the composer's conditional top = spacingMd inset). That offset exactly consumes StreamSnackbar's built-in 16dp bottom padding, so the visible gap drops to 0 in fixed style. Floating style has no top inset, so its gap is already correct.

Added a conditional bottom padding — spacingMd in fixed style, 0 in floating — to MessageComposerAudioRecordingHint and MessageComposerAudioRecordingPermissionRationale in ChatComponentFactory, mirroring the composer's own conditional top inset. This restores the 16dp gap in fixed style and leaves floating style unchanged.

🎨 UI Changes

Recording hint / permission-rationale toast in fixed composer style now keeps a 16px gap above the composer (was flush against it). Floating style is visually unchanged.

Before After
Screenshot_20260601_154141 Screenshot_20260601_154453

Testing

Fixed composer style (default):

  1. Open a chat and tap (don't hold) the mic button → the "Hold to record…" toast appears.
  2. Verify there is a 16px gap between the toast and the top edge of the composer.
  3. Revoke microphone permission, tap the mic → the permission-rationale snackbar shows with the same 16px gap.

Floating composer style (ComposerConfig(floatingStyleEnabled = true)):
4. Repeat the steps above → spacing is unchanged (still 16px), confirming no regression.

Summary by CodeRabbit

  • Style
    • Enhanced audio recording feedback message positioning in the message composer. Snackbar padding now intelligently adjusts based on the active composer style—padding is removed when floating style is enabled for a compact design, otherwise standard spacing is applied for proper alignment.

The recording hint and permission rationale snackbars lost their gap above
the composer in fixed style: the toast anchors to the record button, whose
16dp inset consumed the snackbar's own bottom padding, collapsing the gap to
~0px. Add matching bottom padding in fixed style so both keep a 16dp gap, as
they already do in floating style and as the design specifies.

AND-1210
@andremion andremion requested a review from a team as a code owner June 1, 2026 14:41
@andremion andremion added the pr:bug Bug fix label Jun 1, 2026
@andremion
Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 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, or the PR is bot-authored.
  • An issue is linked (Linear ticket or GitHub issue), or the PR is bot-authored.

🎉 Great job! This PR is ready for review.

@andremion andremion added the pr:improvement Improvement label Jun 1, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Walkthrough

This PR modifies two audio recording snackbar components in the message composer to conditionally adjust their bottom padding based on whether the composer uses floating-style layout. When enabled, snackbars use zero padding; otherwise, they use standard medium spacing.

Changes

Conditional Snackbar Bottom Padding in Composer

Layer / File(s) Summary
Conditional bottom padding for audio recording snackbars
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
MessageComposerAudioRecordingPermissionRationale and MessageComposerAudioRecordingHint now pass a modifier to StreamSnackbar that conditionally sets bottom padding to 0.dp when ChatTheme.config.composer.floatingStyleEnabled is enabled, otherwise to StreamTokens.spacingMd.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

  • GetStream/stream-chat-android#6423: Adjusts composer snackbar layout by changing how StreamSnackbar is rendered with bottom padding/modifier for correct positioning relative to the composer input.

Suggested labels

pr:improvement

Suggested reviewers

  • VelikovPetar

Poem

🐰 A rabbit hops through padding layers bright,
Making snackbars dance when floating's in sight,
Conditional spacing keeps UI just right,
No more unstyled corners blocking the light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: fixing the recording toast spacing above the fixed-style composer.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is comprehensive and well-structured, covering all required sections from the template including goal, implementation, UI changes with before/after screenshots, and detailed testing instructions.

✏️ 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 and-1210-voice-message-recording-toast-spacing-above-the-composer

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.

@andremion andremion enabled auto-merge (squash) June 1, 2026 14:45
@andremion andremion removed the pr:bug Bug fix label Jun 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 1, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.83 MB 5.83 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.07 MB 11.07 MB 0.00 MB 🟢
stream-chat-android-compose 12.46 MB 12.46 MB 0.00 MB 🟢

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 1, 2026

@andremion andremion merged commit 2c86c43 into develop Jun 1, 2026
18 checks passed
@andremion andremion deleted the and-1210-voice-message-recording-toast-spacing-above-the-composer branch June 1, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants