Skip to content

Add spacing between composer snackbar and input row#6423

Open
andremion wants to merge 3 commits intodevelopfrom
fix/sdk-composer-snackbar-position
Open

Add spacing between composer snackbar and input row#6423
andremion wants to merge 3 commits intodevelopfrom
fix/sdk-composer-snackbar-position

Conversation

@andremion
Copy link
Copy Markdown
Contributor

@andremion andremion commented May 7, 2026

Goal

Address the SDK Testing Feedback ticket to fix the vertical snackbar position.

Implementation

  • Add MessageComposerSnackbar to ChatComponentFactory with a matching MessageComposerSnackbarParams holder, mirroring the pattern used by the audio-recording snackbars. The default applies 16 dp bottom padding around the visible card.
  • StreamSnackbar.modifier now applies to the outer Box instead of the inner Surface (idiomatic Compose; internal-only API).
  • Replace the hardcoded 4.dp shadow with StreamTokens.elevation3.
  • Drop a redundant padding(vertical = spacing2xs) on the input Row (no Figma backing) and a wrapContentHeight() modifier on the MessageComposer call in ChannelScreen (had no effect — the parent Column already grants intrinsic vertical sizing).
  • Re-record MessageComposerTest snapshots.

🎨 UI Changes

Fixed Style

Attachment Picker Suggestions Popup
Screenshot_20260507_111852 Screenshot_20260507_111841

Floating Style

Attachment Picker Suggestions Popup
Screenshot_20260507_112550 Screenshot_20260507_112608

Testing

  1. Open any channel in the Compose sample, reply to a message, then trigger an unavailable command (e.g. /giphy while replying).
    • Expected: snackbar above the input with a clear gap.
  2. Open the attachment picker → commands tab → tap an unavailable command in the same reply state.
    • Expected: same spacing.
  3. Toggle floating composer and repeat.
    • Expected: snackbar still sits above the floating composer with the gap.

Summary by CodeRabbit

  • Bug Fixes

    • Fixed message composer snackbar display functionality.
  • Style

    • Updated shadow elevation design tokens for improved visual consistency across snackbar components.
  • Refactor

    • Enhanced message composer UI layout and IME window inset handling for better responsiveness.

andremion added 2 commits May 7, 2026 11:20
Address the SDK Testing Feedback ticket about snackbar spacing in the
fixed-style composer. Override the snackbar lambda at the composer
call site to add 16 dp bottom padding around the visible card.
Combined with the existing 16 dp padding inside StreamSnackbar, the
visible gap above the input row is now 32 dp.

Other changes:
- StreamSnackbar.modifier now applies to the outer Box instead of the
  inner Surface (idiomatic Compose; internal-only API).
- Replace the hardcoded 4.dp shadow with StreamTokens.elevation3.
- The new entry in the api dump is the auto-generated holder for the
  inline snackbar lambda.
The Row's padding(vertical = spacing2xs) added 8 dp to the composer
surface with no Figma backing; the inner padding already provides the
spec spacing. Also remove a wrapContentHeight() from the
MessageComposer call in ChannelScreen — Column already grants
intrinsic vertical sizing to its children, so the modifier had no
effect.

Re-record MessageComposerTest snapshots.
@andremion andremion added the pr:improvement Improvement label May 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 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 ignored for dependabot PRs).

🎉 Great job! This PR is ready for review.

@andremion
Copy link
Copy Markdown
Contributor Author

@CodeRabbit review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 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 May 7, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.82 MB 5.82 MB 0.00 MB 🟢
stream-chat-android-ui-components 11.02 MB 11.02 MB 0.00 MB 🟢
stream-chat-android-compose 12.37 MB 12.38 MB 0.00 MB 🟢

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack

Walkthrough

The PR updates snackbar rendering in the message composer by applying design tokens for elevation, wiring snackbar data through the StreamSnackbar composable, simplifying layout modifiers, and exposing a new generated lambda in the public API.

Changes

Snackbar Component and Composer Integration

Layer / File(s) Summary
Design Token Application
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/StreamSnackbar.kt
Surface elevation is updated from hardcoded shadow(4.dp, shape = SnackbarShape) to use StreamTokens.elevation3.
Message Composer Snackbar Wiring
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt
Imports StreamSnackbar and updates SnackbarPopup to render each snackbar data through StreamSnackbar composable with bottom padding applied.
Channel Screen Layout
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.kt
MessageComposer modifier simplified from fillMaxWidth().wrapContentHeight() to fillMaxWidth(); imports updated to include WindowInsets, ime, and consumeWindowInsets.
Generated API Surface
stream-chat-android-compose/api/stream-chat-android-compose.api
New lambda accessor getLambda$-1407581416$stream_chat_android_compose_release() added to ComposableSingletons$MessageComposerKt public API.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A snackbar hops with tokens bright,
From hardcoded depths to design's light,
The composer wires it with care,
Elevation three floats in the air!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding spacing between the composer snackbar and input row, which is the primary focus of the PR.
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 PR description is comprehensive, covering goal, implementation details, UI changes with screenshots, and testing steps as required by 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 fix/sdk-composer-snackbar-position

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt`:
- Around line 333-338: The Snackbar call in MessageComposer.kt applies
Modifier.padding(bottom = StreamTokens.spacingMd) which duplicates the internal
all-sides padding in StreamSnackbar and doubles the bottom gap; remove the
external bottom padding and pass either no modifier or Modifier directly into
StreamSnackbar in the SnackbarPopup lambda so the single built-in padding from
StreamSnackbar (StreamTokens.spacingMd) controls the gap.
🪄 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: cbab13d5-0e3c-41dc-9cf4-7a29c90e7588

📥 Commits

Reviewing files that changed from the base of the PR and between 75cafde and 3bb700f.

⛔ Files ignored due to path filters (10)
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style_with_command_suggestions.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style_with_user_suggestions.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style_with_visible_attachment_picker.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_command_suggestions_in_dark_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_command_suggestions_in_light_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_user_suggestions_in_dark_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_user_suggestions_in_light_mode.png is excluded by !**/*.png
  • stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_visible_attachment_picker.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • stream-chat-android-compose/api/stream-chat-android-compose.api
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/StreamSnackbar.kt

@andremion andremion marked this pull request as ready for review May 7, 2026 10:36
@andremion andremion requested a review from a team as a code owner May 7, 2026 10:36
@andremion andremion enabled auto-merge (squash) May 7, 2026 10:36
@andremion andremion marked this pull request as draft May 7, 2026 12:06
auto-merge was automatically disabled May 7, 2026 12:06

Pull request was converted to draft

Add MessageComposerSnackbar to the factory with a matching
MessageComposerSnackbarParams holder, mirroring the pattern used by the
audio-recording snackbars. The default keeps the 16 dp bottom padding
introduced in the previous commit. Customers can now override the
composer-level snackbar appearance the same way they can override other
composer slots.
@andremion andremion marked this pull request as ready for review May 7, 2026 12:21
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 7, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
40.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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.

1 participant