Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
WalkthroughThis PR refactors capability handling across the chat UI stack by replacing Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 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
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/api/stream-chat-android-compose.api (1)
1643-1657:⚠️ Potential issue | 🟠 MajorKeep backward-compatible overloads for
MessageOptionItemVisibilitypublic API.Line 1643 and Line 1656 change constructor/copy arity (10 → 11 booleans), which is a binary/source-breaking change for existing consumers. Please keep deprecated overloads with the previous signatures (delegating with
isMuteUserVisible = true) to avoid breaking v7 adopters.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/api/stream-chat-android-compose.api` around lines 1643 - 1657, The public API for MessageOptionItemVisibility changed arity (10 → 11 booleans) and will break callers; restore backward-compatible overloads: add deprecated constructor and deprecated copy overloads that match the old 10-Boolean signatures and delegate to the new primary constructor/copy by passing isMuteUserVisible = true; ensure the overload names match MessageOptionItemVisibility's existing constructors and copy/copy$default so callers keep binary/source compatibility and annotate them deprecated with a migration note.
🧹 Nitpick comments (1)
stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt (1)
1605-1619: Please add direct tests for new mute/unmute action branches.Line 1618 and Line 1619 add new
performMessageActionpaths; controller-level tests here would lock down dispatch behavior and prevent regressions.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt` around lines 1605 - 1619, Add controller-level tests for performMessageAction covering the new MuteUser and UnmuteUser branches: write unit tests that call MessageListController.performMessageAction with a MuteUser and an UnmuteUser action respectively, verify that the controller invokes muteUser(message.user) and unmuteUser(message.user) (mock or spy the controller methods), and ensure no other branches are executed (e.g., overlay removed and no incorrect _messageActions changes). Target the MessageListController test file and assert side-effects/interaction counts to lock down dispatch behavior and prevent regressions.
🤖 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/api/stream-chat-android-compose.api`:
- Line 1676: Restore the original public overload of defaultMessageOptionsState
that accepts Set<String> (the old signature) instead of replacing it; mark that
overload as `@Deprecated` and have it delegate its work to the new
defaultMessageOptionsState that accepts Channel by converting or mapping the
Set<String> into a Channel-compatible form (or by extracting the necessary info
and calling the new method), ensuring both methods coexist so you avoid the hard
API break while the new Channel-based API is the primary implementation.
---
Outside diff comments:
In `@stream-chat-android-compose/api/stream-chat-android-compose.api`:
- Around line 1643-1657: The public API for MessageOptionItemVisibility changed
arity (10 → 11 booleans) and will break callers; restore backward-compatible
overloads: add deprecated constructor and deprecated copy overloads that match
the old 10-Boolean signatures and delegate to the new primary constructor/copy
by passing isMuteUserVisible = true; ensure the overload names match
MessageOptionItemVisibility's existing constructors and copy/copy$default so
callers keep binary/source compatibility and annotate them deprecated with a
migration note.
---
Nitpick comments:
In
`@stream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.kt`:
- Around line 1605-1619: Add controller-level tests for performMessageAction
covering the new MuteUser and UnmuteUser branches: write unit tests that call
MessageListController.performMessageAction with a MuteUser and an UnmuteUser
action respectively, verify that the controller invokes muteUser(message.user)
and unmuteUser(message.user) (mock or spy the controller methods), and ensure no
other branches are executed (e.g., overlay removed and no incorrect
_messageActions changes). Target the MessageListController test file and assert
side-effects/interaction counts to lock down dispatch behavior and prevent
regressions.
ℹ️ 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 (2)
stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_SelectedMessageMenuTest_their_message.pngis excluded by!**/*.pngstream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.messages_SelectedMessageMenuTest_their_message_in_dark_mode.pngis excluded by!**/*.png
📒 Files selected for processing (16)
stream-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/messageoptions/MessageOptionItemVisibility.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messageoptions/MessageOptions.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/MessagesScreen.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/util/extensions/MessageOptionItemVisibility.ktstream-chat-android-compose/src/test/kotlin/io/getstream/chat/android/compose/util/extensions/MessageOptionItemVisibilityTest.ktstream-chat-android-docs/src/main/kotlin/io/getstream/chat/docs/kotlin/compose/messages/SelectedMessageMenu.ktstream-chat-android-ui-common/api/stream-chat-android-ui-common.apistream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/feature/messages/list/MessageListController.ktstream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/messages/MessageAction.ktstream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/state/messages/list/SelectedMessageState.ktstream-chat-android-ui-common/src/main/kotlin/io/getstream/chat/android/ui/common/utils/CapabilitiesHelper.ktstream-chat-android-ui-common/src/test/kotlin/io/getstream/chat/android/ui/common/utils/CapabilitiesHelperTest.ktstream-chat-android-ui-components/src/main/kotlin/io/getstream/chat/android/ui/feature/messages/list/MessageListView.kt
| currentUser: User?, | ||
| message: Message, | ||
| channel: Channel, | ||
| ): Boolean = muteUserEnabled && channel.config.muteEnabled && !message.isOwnMessage(currentUser) |



Goal
The new designs also show the mute action in the message menu, so here we implement it
Implementation
MuteUser/UnmuteUsertoMessageActionsChanneltoSelectedMessageStatebecause capabilities aren't enough to know if muting is possible🎨 UI Changes
No UI-specific change, just the mute action will start showing up.
Testing
You can check in the sample that muting/unmuting through the message action works
Summary by CodeRabbit
Release Notes