Introduce ReactionIcon and ReactionToggle components#6144
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
@coderabbitai review |
SDK Size Comparison 📏
|
✅ Actions performedReview triggered.
|
WalkthroughIntroduces two new Compose UI components for rendering reaction emojis: ReactionIcon for static emoji display and ReactionToggle for clickable emoji toggles with visual feedback. Each component supports multiple size variations and is integrated into ChatComponentFactory via new public factory methods. 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 Issue Planner is now in beta. Read the docs and try it out! 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactions/ReactionIcon.kt (2)
32-44: KDoc is incomplete —@param typeand@param emojiare missing.The KDoc documents
sizeandmodifierbut omitstypeandemoji. Since this is aninternalfunction exposed via the publicChatComponentFactory, documenting all parameters helps maintainers understand the contract.Also,
typeis accepted but unused in the function body. It's presumably kept so customChatComponentFactoryoverrides can use it — consider adding a brief note in the KDoc to clarify its purpose (e.g., "reserved for custom factory implementations").
67-68: Preview should use@StreamPreviewhelpers instead of@Preview.Based on learnings: "Compose previews should use
StreamPreviewhelpers."stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/reactions/ReactionToggle.kt (2)
89-93:Largemaps toReactionIconSize.Medium— verify this is intentional.Both
MediumandLargetoggle sizes map toReactionIconSize.Medium(lines 90-91). This means increasing fromMediumtoLargeonly grows the container (32dp → 40dp) without changing the icon font size. If this is intentional (more padding around the emoji atLarge), a brief comment would help future maintainers understand the design decision.
95-96: Preview should use@StreamPreviewhelpers instead of@Preview.Same as in
ReactionIcon.kt. Based on learnings: "Compose previews should useStreamPreviewhelpers."
c18be23 to
182d559
Compare
|


Goal
Introduce
ReactionIconandReactionTogglecomponents. They will be used later for displaying reactions in the SDK instead of the current implementations.Implementation
They are simple components rendering an emoji (
ReactionIcon) + a checked state (ReactionToggle). We only support emojis as that's the direction we're taking going forward as emojis is the standard in chat apps. If customers want image-based reactions, they will be able to replaceReactionIcon.🎨 UI Changes
Figma
Figma
Testing
They aren't in use yet, so they can only be checked in previews.
Summary by CodeRabbit