Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
1b80836 to
a20e02f
Compare
a20e02f to
f050a8a
Compare
|
WalkthroughThe reaction selection UI components are refactored to improve state management. The grid cell size in ExtendedReactionsOptions is increased from 48.dp to 56.dp. ReactionCountRow's public API is simplified to use an optional Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 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.
🧹 Nitpick comments (2)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionsMenu.kt (1)
188-204: Consider usingArrangement.spacedByinstead of manualSpacer.The current implementation adds a
Spacerafter every item, including the last one, resulting in extra bottom padding. UsingArrangement.spacedByin aColumnwould provide consistent spacing without trailing space.♻️ Suggested refactor
`@Composable` private fun UserReactionsList( userReactions: List<UserReactionItemState>, onReactionOptionSelected: (String) -> Unit, ) { + Column(verticalArrangement = Arrangement.spacedBy(8.dp)) { - userReactions.forEach { item -> - UserReactionRow( - item = item, - onClick = if (item.isMine) { - { onReactionOptionSelected(item.type) } - } else { - null - }, - ) - Spacer(modifier = Modifier.height(8.dp)) + userReactions.forEach { item -> + UserReactionRow( + item = item, + onClick = if (item.isMine) { + { onReactionOptionSelected(item.type) } + } else { + null + }, + ) + } } }🤖 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/selectedmessage/ReactionsMenu.kt` around lines 188 - 204, Replace the manual Spacer after every item in UserReactionsList (which currently causes trailing bottom padding) by wrapping the items in a Column with verticalArrangement = Arrangement.spacedBy(8.dp); keep the existing UserReactionRow usage and the conditional onClick logic, but remove the per-item Spacer(modifier = Modifier.height(8.dp)) so spacing is handled by the Column's arrangement.stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactionoptions/ExtendedReactionsOptions.kt (1)
71-72: Remove@ExperimentalFoundationApiannotations from preview functions.
LazyVerticalGridhas been stable since Compose Foundation 1.2.0. The project uses Foundation 1.9.0, making these annotations (lines 71 and 86) unnecessary and can be safely removed.🤖 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/reactionoptions/ExtendedReactionsOptions.kt` around lines 71 - 72, Remove the unnecessary `@ExperimentalFoundationApi` annotation from the preview functions in ExtendedReactionsOptions (the annotations immediately above the `@Preview` declarations) because LazyVerticalGrid is stable; delete those annotation lines and any now-unused imports (the ExperimentalFoundationApi import) so the previews compile cleanly while keeping the existing `@Preview` and function signatures intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactionoptions/ExtendedReactionsOptions.kt`:
- Around line 71-72: Remove the unnecessary `@ExperimentalFoundationApi`
annotation from the preview functions in ExtendedReactionsOptions (the
annotations immediately above the `@Preview` declarations) because
LazyVerticalGrid is stable; delete those annotation lines and any now-unused
imports (the ExperimentalFoundationApi import) so the previews compile cleanly
while keeping the existing `@Preview` and function signatures intact.
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionsMenu.kt`:
- Around line 188-204: Replace the manual Spacer after every item in
UserReactionsList (which currently causes trailing bottom padding) by wrapping
the items in a Column with verticalArrangement = Arrangement.spacedBy(8.dp);
keep the existing UserReactionRow usage and the conditional onClick logic, but
remove the per-item Spacer(modifier = Modifier.height(8.dp)) so spacing is
handled by the Column's arrangement.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: be10023d-1e3f-492f-9db1-704bf49e5d5a
⛔ Files ignored due to path filters (1)
stream-chat-android-compose/src/test/snapshots/images/io.getstream.chat.android.compose.ui.components.reactionpicker_ReactionsPickerTest_Default_reaction_picker_content.pngis excluded by!**/*.png
📒 Files selected for processing (3)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactionoptions/ExtendedReactionsOptions.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionCountRow.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionsMenu.kt


Goal
Couple of fixes:
Implementation
Nothing special really, just direct impl of the fixes above
🎨 UI Changes
UI is mostly identical, just 1 fewer column on common devices. Visible in the new paparazzi snapshot
Testing
You can check both in the sample
Summary by CodeRabbit
Release Notes
Style
Refactor