Add spacing between composer snackbar and input row#6423
Add spacing between composer snackbar and input row#6423
Conversation
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.
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
SDK Size Comparison 📏
|
WalkthroughThe 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. ChangesSnackbar Component and Composer Integration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 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
⛔ 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.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style_with_command_suggestions.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style_with_user_suggestions.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_fixed_style_with_visible_attachment_picker.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_command_suggestions_in_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_command_suggestions_in_light_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_user_suggestions_in_dark_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_user_suggestions_in_light_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_floating_style_with_visible_attachment_picker.pngis excluded by!**/*.png
📒 Files selected for processing (4)
stream-chat-android-compose/api/stream-chat-android-compose.apistream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/ChannelScreen.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/util/StreamSnackbar.kt
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.
|


Goal
Address the SDK Testing Feedback ticket to fix the vertical snackbar position.
Implementation
MessageComposerSnackbartoChatComponentFactorywith a matchingMessageComposerSnackbarParamsholder, mirroring the pattern used by the audio-recording snackbars. The default applies 16 dp bottom padding around the visible card.StreamSnackbar.modifiernow applies to the outerBoxinstead of the innerSurface(idiomatic Compose; internal-only API).4.dpshadow withStreamTokens.elevation3.padding(vertical = spacing2xs)on the inputRow(no Figma backing) and awrapContentHeight()modifier on theMessageComposercall inChannelScreen(had no effect — the parentColumnalready grants intrinsic vertical sizing).MessageComposerTestsnapshots.🎨 UI Changes
Fixed Style
Floating Style
Testing
/giphywhile replying).Summary by CodeRabbit
Bug Fixes
Style
Refactor