Conversation
…eComposerControllerTest`
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughThis PR refactors the message composer architecture by consolidating customizable content slots from individual MessageComposer parameters into a ChatComponentFactory-based composition system. It introduces a dedicated MessageComposerInputCenterBottomContent component for rendering the thread-mode "also send to channel" toggle, updates API signatures to reflect the new structure, and renames string resources for consistency. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
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 unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt (1)
117-121:⚠️ Potential issue | 🔴 Critical
FocusRequestercall will crash—requester is never attached to any composable.On lines 117-121,
inputFocusRequester.requestFocus()is called wheninputFocusEventsemits, but this requester is never passed to any component or attached viaModifier.focusRequester(). TheMessageComposerInputfactory and its underlyingMessageInputandBasicTextFieldcomponents receive no focusRequester parameter. CallingrequestFocus()on an unattached requester throws at runtime.Either wire the requester to the text input via
Modifier.focusRequester()or remove the collector and focus logic until the wiring is restored.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt` around lines 117 - 121, The code calls inputFocusRequester.requestFocus() from the LaunchedEffect collecting viewModel.inputFocusEvents but the FocusRequester (inputFocusRequester) is never attached to any composable, so requestFocus() will crash; fix by wiring the requester into the text input chain (pass inputFocusRequester into MessageComposerInput/MessageInput and attach it with Modifier.focusRequester(inputFocusRequester) on the BasicTextField) or remove the LaunchedEffect/collector until focus wiring is implemented so inputFocusRequester.requestFocus() is not invoked on an unattached requester.
🧹 Nitpick comments (8)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerInputCenterBottomContent.kt (1)
118-126: Parameter shadowing inAnimatedContentlambda.The lambda parameter
checkedshadows the outer function parameter of the same name. While this works correctly, it can reduce code clarity. Consider renaming the lambda parameter.♻️ Proposed fix to avoid shadowing
- AnimatedContent(checked) { checked -> - if (checked) { + AnimatedContent(checked) { isChecked -> + if (isChecked) { Icon( painter = painterResource(id = R.drawable.stream_compose_ic_checkmark), contentDescription = null, tint = ChatTheme.colors.controlRadioCheckIconSelected, ) } }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerInputCenterBottomContent.kt` around lines 118 - 126, The inner lambda parameter of AnimatedContent currently named "checked" shadows the outer "checked" parameter; rename the AnimatedContent lambda parameter (e.g., to "isChecked" or "innerChecked") and update its usages inside the lambda (the Icon block and any conditional) so the outer "checked" remains distinct; locate the AnimatedContent call in MessageComposerInputCenterBottomContent (symbol: AnimatedContent(checked) { ... }) and only change the lambda parameter name and its references.stream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customattachments/CustomChatComponentFactory.kt (1)
58-78: Themodifierparameter is not applied to the composable.The
modifierparameter is defined but not used. Per Compose best practices, the modifier should be applied to the outermost composable to allow callers to customize layout behavior.♻️ Proposed fix to apply the modifier
`@Composable` override fun MessageComposerLeadingContent( modifier: Modifier, state: MessageComposerState, isAttachmentPickerVisible: Boolean, onAttachmentsClick: () -> Unit, ) { IconButton( - modifier = Modifier + modifier = modifier .size(48.dp) .padding(12.dp), content = {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customattachments/CustomChatComponentFactory.kt` around lines 58 - 78, The MessageComposerLeadingContent composable ignores its modifier parameter; update the IconButton call to use the incoming modifier as the outermost modifier (e.g., combine the passed-in modifier with the local size/padding using modifier.size(48.dp).padding(12.dp) or modifier.then(...)) so callers can customize layout; change the IconButton's modifier argument (currently Modifier.size(...).padding(...)) to use the provided modifier combined with the size/padding while keeping the rest of the implementation (Icon and onClick) intact.stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/ui/CustomComposerAndAttachmentsPicker.kt (1)
185-198: Consider wiringonAlsoSendToChannelChangefor thread mode support.The
MessageInputcomponent now accepts anonAlsoSendToChannelChangeparameter (seeMessageInput.ktlines 72-151 in the relevant snippets), but it's not passed here. If this cookbook example should support thread mode with the "Also send in Channel" checkbox, you may need to add this callback.If thread mode is intentionally not supported in this example, this is fine as-is.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/ui/CustomComposerAndAttachmentsPicker.kt` around lines 185 - 198, The MessageInput call is missing the new onAlsoSendToChannelChange callback; wire it to the composer view model by adding onAlsoSendToChannelChange = { composerViewModel.setAlsoSendToChannel(it) } (or the appropriate setter in composerViewModel if named differently) so the "Also send in Channel" checkbox updates the composer state and enables thread-mode support (referencing MessageInput, onAlsoSendToChannelChange, and composerViewModel).stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/AddingCustomAttachments.kt (1)
173-176: Use the incomingmodifierin the custom leading slot.On Line [174],
Modifieris hardcoded, so any modifier passed intoMessageComposerLeadingContentis dropped.♻️ Proposed fix
IconButton( - modifier = Modifier + modifier = modifier .size(48.dp) .padding(12.dp),Based on learnings, in Compose UI components modifiers should be applied on the outermost composable so caller-provided modifiers are preserved.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/AddingCustomAttachments.kt` around lines 173 - 176, The custom leading slot drops the caller-provided modifier because IconButton uses the hardcoded Modifier instead of the incoming modifier parameter; in MessageComposerLeadingContent (the composable containing the IconButton), replace the hardcoded Modifier with the function's modifier and chain the existing size(48.dp) and padding(12.dp) onto it (e.g., modifier.size(...).padding(...)) so caller modifiers are preserved and still apply the size/padding.stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt (3)
1425-1443: Factory API still exposes the old callback name.Line [1425] keeps
onAlsoSendToChannelSelectedwhile the rest of the redesigned composer API usesonAlsoSendToChannelChange. Consider renaming here too (or deprecating old name with a forwarder) to avoid mixed migration surface.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt` around lines 1425 - 1443, The factory currently exposes the old callback name onAlsoSendToChannelSelected while the composer API expects onAlsoSendToChannelChange; update the ChatComponentFactory signature to use onAlsoSendToChannelChange and pass it into io.getstream.chat.android.compose.ui.messages.composer.MessageComposer (replace onAlsoSendToChannelSelected with onAlsoSendToChannelChange), and if you need backward compatibility add a deprecated onAlsoSendToChannelSelected parameter that simply forwards to the new onAlsoSendToChannelChange to avoid breaking callers.
1613-1623: Apply themodifierparameter inMessageComposerLeadingContent.The new
modifierargument is currently ignored, so caller-provided layout/semantics cannot flow through.♻️ Proposed fix
public fun MessageComposerLeadingContent( modifier: Modifier, state: MessageComposerState, isAttachmentPickerVisible: Boolean, onAttachmentsClick: () -> Unit, ) { - io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerLeadingContent( - messageInputState = state, - isAttachmentPickerVisible = isAttachmentPickerVisible, - onAttachmentsClick = onAttachmentsClick, - ) + Box(modifier = modifier) { + io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerLeadingContent( + messageInputState = state, + isAttachmentPickerVisible = isAttachmentPickerVisible, + onAttachmentsClick = onAttachmentsClick, + ) + } }Based on learnings, in Compose UI components modifiers should be applied on the outermost composable so caller-provided modifiers are preserved.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt` around lines 1613 - 1623, The public MessageComposerLeadingContent is ignoring the incoming modifier; forward and apply it to the outermost internal composable call so caller modifiers flow through. Update the public MessageComposerLeadingContent to pass the modifier argument into io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerLeadingContent (alongside messageInputState = state, isAttachmentPickerVisible, onAttachmentsClick) so the modifier is applied to the outermost composable.
1766-1779:MessageComposerInputCenterBottomContentdrops itsmodifier.Line [1769] accepts a
modifierbut it is never used. This prevents external layout/styling control.♻️ Proposed fix
- AnimatedContent(targetState = inThreadMode) { visible -> + AnimatedContent( + modifier = modifier, + targetState = inThreadMode, + ) { visible -> if (visible) { io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerInputCenterBottomContent( alsoSendToChannel = state.alsoSendToChannel, onAlsoSendToChannelChange = onAlsoSendToChannelChange, ) } }Based on learnings, in Compose UI components modifiers should be applied on the outermost composable so caller-provided modifiers are preserved.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt` around lines 1766 - 1779, The supplied modifier parameter is never applied in MessageComposerInputCenterBottomContent; apply it to the outer composable (use the modifier on AnimatedContent) so caller styling/layout is respected, and also forward it to the inner component call io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerInputCenterBottomContent (or wrap that call in a container using the modifier) so the modifier affects the rendered content.stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt (1)
73-73: Please avoid an undocumented suppression in this path.Line [73] introduces
@Suppress("LongMethod")without rationale. Prefer extracting helpers or documenting why suppression is required.As per coding guidelines, "
**/*.kt: Use@OptInannotations explicitly; avoid suppressions unless documented."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt` at line 73, Remove the undocumented suppression `@Suppress`("LongMethod") in MessageInput.kt: either refactor the long function(s) inside the MessageInput component into smaller helper functions (e.g., extract UI sections or input-handling logic into private functions) to eliminate the need for the suppression, or if suppression is absolutely necessary, replace it with a documented justification using a KDoc comment above the suppression explaining why refactoring is impractical and referencing the specific function/class (MessageInput) it applies to; prefer using `@OptIn` where appropriate per guidelines instead of an undocumented `@Suppress`.
🤖 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-compose/src/main/res/values-hi/strings.xml`:
- Around line 76-77: Add the missing Hindi localization for the string resource
stream_compose_message_composer_cannot_send_placeholder by adding an entry in
the Hindi strings.xml (same key as other locales) with an appropriate Hindi
translation, ensuring you follow the existing XML string format (no extra
surrounding quotes and proper escaping for special characters) so the app shows
Hindi text when message sending is disabled.
---
Outside diff comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt`:
- Around line 117-121: The code calls inputFocusRequester.requestFocus() from
the LaunchedEffect collecting viewModel.inputFocusEvents but the FocusRequester
(inputFocusRequester) is never attached to any composable, so requestFocus()
will crash; fix by wiring the requester into the text input chain (pass
inputFocusRequester into MessageComposerInput/MessageInput and attach it with
Modifier.focusRequester(inputFocusRequester) on the BasicTextField) or remove
the LaunchedEffect/collector until focus wiring is implemented so
inputFocusRequester.requestFocus() is not invoked on an unattached requester.
---
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.kt`:
- Line 73: Remove the undocumented suppression `@Suppress`("LongMethod") in
MessageInput.kt: either refactor the long function(s) inside the MessageInput
component into smaller helper functions (e.g., extract UI sections or
input-handling logic into private functions) to eliminate the need for the
suppression, or if suppression is absolutely necessary, replace it with a
documented justification using a KDoc comment above the suppression explaining
why refactoring is impractical and referencing the specific function/class
(MessageInput) it applies to; prefer using `@OptIn` where appropriate per
guidelines instead of an undocumented `@Suppress`.
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerInputCenterBottomContent.kt`:
- Around line 118-126: The inner lambda parameter of AnimatedContent currently
named "checked" shadows the outer "checked" parameter; rename the
AnimatedContent lambda parameter (e.g., to "isChecked" or "innerChecked") and
update its usages inside the lambda (the Icon block and any conditional) so the
outer "checked" remains distinct; locate the AnimatedContent call in
MessageComposerInputCenterBottomContent (symbol: AnimatedContent(checked) { ...
}) and only change the lambda parameter name and its references.
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt`:
- Around line 1425-1443: The factory currently exposes the old callback name
onAlsoSendToChannelSelected while the composer API expects
onAlsoSendToChannelChange; update the ChatComponentFactory signature to use
onAlsoSendToChannelChange and pass it into
io.getstream.chat.android.compose.ui.messages.composer.MessageComposer (replace
onAlsoSendToChannelSelected with onAlsoSendToChannelChange), and if you need
backward compatibility add a deprecated onAlsoSendToChannelSelected parameter
that simply forwards to the new onAlsoSendToChannelChange to avoid breaking
callers.
- Around line 1613-1623: The public MessageComposerLeadingContent is ignoring
the incoming modifier; forward and apply it to the outermost internal composable
call so caller modifiers flow through. Update the public
MessageComposerLeadingContent to pass the modifier argument into
io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerLeadingContent
(alongside messageInputState = state, isAttachmentPickerVisible,
onAttachmentsClick) so the modifier is applied to the outermost composable.
- Around line 1766-1779: The supplied modifier parameter is never applied in
MessageComposerInputCenterBottomContent; apply it to the outer composable (use
the modifier on AnimatedContent) so caller styling/layout is respected, and also
forward it to the inner component call
io.getstream.chat.android.compose.ui.messages.composer.internal.MessageComposerInputCenterBottomContent
(or wrap that call in a container using the modifier) so the modifier affects
the rendered content.
In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/AddingCustomAttachments.kt`:
- Around line 173-176: The custom leading slot drops the caller-provided
modifier because IconButton uses the hardcoded Modifier instead of the incoming
modifier parameter; in MessageComposerLeadingContent (the composable containing
the IconButton), replace the hardcoded Modifier with the function's modifier and
chain the existing size(48.dp) and padding(12.dp) onto it (e.g.,
modifier.size(...).padding(...)) so caller modifiers are preserved and still
apply the size/padding.
In
`@stream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/ui/CustomComposerAndAttachmentsPicker.kt`:
- Around line 185-198: The MessageInput call is missing the new
onAlsoSendToChannelChange callback; wire it to the composer view model by adding
onAlsoSendToChannelChange = { composerViewModel.setAlsoSendToChannel(it) } (or
the appropriate setter in composerViewModel if named differently) so the "Also
send in Channel" checkbox updates the composer state and enables thread-mode
support (referencing MessageInput, onAlsoSendToChannelChange, and
composerViewModel).
In
`@stream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customattachments/CustomChatComponentFactory.kt`:
- Around line 58-78: The MessageComposerLeadingContent composable ignores its
modifier parameter; update the IconButton call to use the incoming modifier as
the outermost modifier (e.g., combine the passed-in modifier with the local
size/padding using modifier.size(48.dp).padding(12.dp) or modifier.then(...)) so
callers can customize layout; change the IconButton's modifier argument
(currently Modifier.size(...).padding(...)) to use the provided modifier
combined with the size/padding while keeping the rest of the implementation
(Icon and onClick) intact.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (18)
stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_attachments.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_attachments_and_link.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_edit,_attachments,_and_link.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_edit.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_edit_empty.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_filled.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_link.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_overflow.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_placeholder.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_reply,_attachments,_and_link.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_reply.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_slow_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_thread_mode.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerInputTest_thread_mode_also_send_to_channel.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_default_style.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_MessageComposerTest_default_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_visible_attachment_picker.pngis excluded by!**/*.png
📒 Files selected for processing (24)
stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/add/AddChannelActivity.ktstream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/add/AddChannelScreen.ktstream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.ktstream-chat-android-compose/api/stream-chat-android-compose.apistream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/composer/MessageInput.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/PollCreationHeader.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/messages/composer/internal/MessageComposerDefaults.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerInputCenterBottomContent.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerInputCenterContent.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerInputTrailingContent.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.ktstream-chat-android-compose/src/main/res/values-es/strings.xmlstream-chat-android-compose/src/main/res/values-hi/strings.xmlstream-chat-android-compose/src/main/res/values/strings.xmlstream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/MessageComposerInputTest.ktstream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/ui/messages/composer/MessageComposerScreenTest.ktstream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/guides/AddingCustomAttachments.ktstream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/MessageComposer.ktstream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/cookbook/ui/CustomComposerAndAttachmentsPicker.ktstream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/composer/MessageComposerController.ktstream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/feature/messages/composer/MessageComposerControllerTest.ktstream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customattachments/CustomChatComponentFactory.ktstream-chat-android-ui-guides/src/main/java/io/getstream/chat/android/guides/catalog/compose/customattachments/MessagesActivity.kt
💤 Files with no reviewable changes (3)
- stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/feature/channel/add/AddChannelScreen.kt
- stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/internal/MessageComposerDefaults.kt
- stream-chat-android-compose-sample/src/main/java/io/getstream/chat/android/compose/sample/ui/MessagesActivity.kt
...pose/src/main/java/io/getstream/chat/android/compose/ui/messages/composer/MessageComposer.kt
Show resolved
Hide resolved
…ontroller` and ViewModels.
|



Goal
Simplify the Compose message composer API and align it with the component-factory model: move header, footer, leading, and trailing slots into
ChatComponentFactoryand consolidate the input area so "also send to channel" and related thread state live inside the input component instead of separate footer/header slots.Implementation
headerContent,footerContent,leadingContent, andtrailingContentparameters; composition is driven byChatComponentFactory(e.g.MessageComposerLeadingContent,MessageComposerInput). RenamedonAlsoSendToChannelSelectedtoonAlsoSendToChannelChangeand pass it into the input.Modifierand no longer usesRowScope. ReplacedleadingContent/centerContent/trailingContentwith a singleMessageComposerInputfactory that owns leading (e.g. attachments), center (text field + link preview), and trailing (send/recording). AddedMessageComposerInputCenterBottomContentin the factory for "also send to channel" in thread mode, so thread UI is inside the input block.MessageComposerHeaderContentandMessageComposerFooterContent. AddedMessageComposerInputCenterBottomContent.MessageComposerLeadingContentandMessageComposerInputnow use an explicitModifierinstead ofRowScope.alsoSendToChannelis preserved when clearing composer data in thread mode.MessagesActivityfrom compose sample; updated custom-attachment sample and "Adding custom attachments" guide to the new factory-based API. Adjusted composer string resource names/placeholders.MessageComposerControllerTest(includingalsoSendToChannelpropagation); added/updatedMessageComposerInputTestand Paparazzi snapshots for the new layout.🎨 UI Changes
Testing
Open a channel → open a thread → reply; confirm "Also send to channel" appears and toggles correctly; clear/compose again and confirm the checkbox state is preserved when applicable.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation