Skip to content

Fix reaction pickers UX in reactions sheet#6225

Draft
gpunto wants to merge 2 commits intov7from
redesign/reaction-pickers-fixes
Draft

Fix reaction pickers UX in reactions sheet#6225
gpunto wants to merge 2 commits intov7from
redesign/reaction-pickers-fixes

Conversation

@gpunto
Copy link
Contributor

@gpunto gpunto commented Mar 6, 2026

Goal

Couple of fixes:

  • The chips on the message reactions sheet should work as filters, not as reaction toggles
  • Update grid cell size for the extended reactions sheet so there's more breathing room

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

    • Enlarged reaction emoji cells within the extended reaction options grid from 48.dp to 56.dp for improved visibility and spacing.
  • Refactor

    • Streamlined reaction selection and filtering mechanism with refined state management; updated how reaction menus track and display selected reactions for more efficient filtering and interaction handling.

@gpunto gpunto added pr:bug Bug fix pr:improvement Improvement labels Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 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.

🎉 Great job! This PR is ready for review.

@gpunto gpunto changed the title Redesign/reaction pickers fixes Fix reaction pickers UX in reactions sheet Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 5.25 MB 5.69 MB 0.44 MB 🟡
stream-chat-android-ui-components 10.60 MB 11.00 MB 0.40 MB 🟡
stream-chat-android-compose 12.81 MB 12.03 MB -0.78 MB 🚀

@gpunto gpunto force-pushed the redesign/reaction-pickers-fixes branch from 1b80836 to a20e02f Compare March 6, 2026 17:09
@gpunto gpunto force-pushed the redesign/reaction-pickers-fixes branch from a20e02f to f050a8a Compare March 9, 2026 08:23
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 9, 2026

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@gpunto gpunto marked this pull request as ready for review March 9, 2026 08:44
@gpunto gpunto requested a review from a team as a code owner March 9, 2026 08:44
@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Walkthrough

The 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 selectedReactionType instead of a list of owned reactions, and ReactionsMenu is updated to manage filtering state locally with toggle behavior.

Changes

Cohort / File(s) Summary
Grid Layout Update
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactionoptions/ExtendedReactionsOptions.kt
Increased default cell size from 48.dp to 56.dp for the adaptive grid layout.
Reaction Selection Logic
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionCountRow.kt, stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionsMenu.kt
Replaced owned reactions list tracking with optional selectedReactionType state for filtering. ReactionCountRow signature changed to accept selectedReactionType and onReactionSelected callback. ReactionsMenu now manages filtering state locally, introduces new UserReactionsList composable for rendering filtered reactions, and implements toggle behavior for reaction selection.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 whiskers twitch with joy

Grid cells stretch to fifty-six,
Reactions dance with state so slick,
A toggle here, a filter there—
The UI flows with utmost care! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately summarizes the main changes: fixing reaction pickers UX in the reactions sheet by making chips act as filters and adjusting grid sizing.
Description check ✅ Passed The PR description covers Goal, Implementation, and UI Changes sections; however, it lacks detailed Testing information and is missing the required Contributor Checklist.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch redesign/reaction-pickers-fixes

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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

@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.

🧹 Nitpick comments (2)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionsMenu.kt (1)

188-204: Consider using Arrangement.spacedBy instead of manual Spacer.

The current implementation adds a Spacer after every item, including the last one, resulting in extra bottom padding. Using Arrangement.spacedBy in a Column would 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 @ExperimentalFoundationApi annotations from preview functions.

LazyVerticalGrid has 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

📥 Commits

Reviewing files that changed from the base of the PR and between dd111d5 and f050a8a.

⛔ 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.png is excluded by !**/*.png
📒 Files selected for processing (3)
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactionoptions/ExtendedReactionsOptions.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionCountRow.kt
  • stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/ReactionsMenu.kt

@gpunto gpunto marked this pull request as draft March 9, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:bug Bug fix pr:improvement Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant