Add message reaction to chat - long press bubble to react emoji#1671
Add message reaction to chat - long press bubble to react emoji#1671shishupalbhati wants to merge 1 commit intoandroid:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances user interaction in the chat application by introducing a message reaction feature. Users can now express themselves more dynamically by long-pressing on any chat bubble to bring up an emoji picker and add a reaction. The chosen reactions are then visually represented below the message, providing a more engaging and expressive chat experience. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces message reactions, triggered by a long press on a message bubble. The implementation is mostly solid, with correct state management for reactions and UI for displaying them. However, I've identified a critical bug where the new long-press handling interferes with existing click functionality for links in messages. Additionally, a new UI test is failing due to an incorrect selector. I've provided specific feedback and code suggestions to address these issues.
| modifier = Modifier.combinedClickable( | ||
| onLongClick = {showEmojiPicker = true}, | ||
| onClick = {}, | ||
| ) |
There was a problem hiding this comment.
Using combinedClickable with an empty onClick lambda consumes tap events. This prevents the ClickableText child composable from handling its own click events, such as for opening links or viewing profiles, which breaks existing functionality.
To fix this, you should use Modifier.pointerInput with detectTapGestures, specifying only the onLongPress handler. This will correctly handle the long press for reactions while allowing tap gestures to be processed by child composables.
modifier = Modifier.pointerInput(Unit) {
detectTapGestures(onLongPress = {
showEmojiPicker = true
})
}| ) | ||
| } | ||
| } | ||
| composeTestRule.onNodeWithTag("Hello!").performTouchInput { longClick() } |
There was a problem hiding this comment.
This test uses onNodeWithTag("Hello!") to find the message composable. However, no testTag with this value is set, which will cause the test to fail.
To correctly find the composable, you should use onNodeWithText("Hello!") instead. The long press gesture will be performed on the correct node and propagate to the parent Surface that handles it.
| composeTestRule.onNodeWithTag("Hello!").performTouchInput { longClick() } | |
| composeTestRule.onNodeWithText("Hello!").performTouchInput { longClick() } |
No description provided.