-
Notifications
You must be signed in to change notification settings - Fork 797
Feat/reactions #838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat/reactions #838
Conversation
1e47e2c
to
7aef98b
Compare
87296f1
to
350c450
Compare
@demchenkoalex maybe we should expose params as config object everywhere. |
…ider to another context
(maybe we should pass a randomValueKey when instancing instead?)
hey @nicolasbraun can't thank you enough for this! I just started reviewing (was working on quite a bit change for two-sided pagination, released in 2.9.0) and this looks amazing 🤩 will deep dive into code now to understand how it works and make changes if necessary. I am now paying for the bugbot from Cursor (just until Aug 10 to test) so will run as well to see what it says. |
179f91a
to
78ceecc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive reaction support to the Flutter chat UI, following the Signal/WhatsApp style with a row of reactions under message bubbles and long-press contextual menus. The implementation creates a new flyer_chat_reactions
package to provide this functionality without making the main UI library dependent on reactions.
Key changes:
- New standalone package for reaction widgets and functionality
- Breaking changes to callback signatures to include
isSentByMe
parameter - Support for both tap-to-react and tap-to-show-list behaviors
Reviewed Changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated 7 comments.
Show a summary per file
File | Description |
---|---|
packages/flyer_chat_reactions/ | New package providing reaction widgets, models, and helpers |
packages/flutter_chat_ui/lib/src/utils/typedefs.dart | Added isSentByMe parameter to message callback signatures |
packages/flutter_chat_ui/lib/src/chat_message/chat_message.dart | Integrated reactions builder and updated gesture handling |
packages/flutter_chat_core/lib/src/models/message.dart | Added MessageReactions typedef and updated message types |
packages/flutter_chat_core/lib/src/theme/chat_theme.dart | Added surfaceContainerHighest color for elevated surfaces |
examples/flyer_chat/ | Updated example to demonstrate reaction functionality |
packages/flyer_chat_reactions/lib/src/widgets/reactions_dialog.dart
Outdated
Show resolved
Hide resolved
packages/flyer_chat_reactions/lib/src/widgets/reaction_tile.dart
Outdated
Show resolved
Hide resolved
packages/flutter_chat_ui/lib/src/chat_message/chat_message.dart
Outdated
Show resolved
Hide resolved
reactionsWidget != null | ||
? Stack( | ||
children: [ | ||
// TODO Find better way to add height for the reactions widget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The hardcoded SizedBox(height: 16) is a temporary solution for reactions spacing. This could cause layout issues with different reaction configurations or screen sizes. Consider using a more dynamic approach based on actual reaction widget height.
Copilot uses AI. Check for mistakes.
packages/flyer_chat_reactions/lib/src/widgets/reaction_tile.dart
Outdated
Show resolved
Hide resolved
packages/flyer_chat_reactions/lib/src/widgets/flyer_chat_reactions_row.dart
Outdated
Show resolved
Hide resolved
packages/flyer_chat_reactions/lib/src/widgets/reaction_tile.dart
Outdated
Show resolved
Hide resolved
@cursor review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bugbot free trial expires on July 29, 2025
Learn more in the Cursor dashboard.
Hey @nicolasbraun - after taking a closer look, I realised that the menu has also been recreated, and honestly, it doesn’t look great. It lacks animation, has no hover effects, and feels pretty static. Plus, it introduces another layer to maintain. My long-term goal was to go fully native, similar to this: Screen.Recording.2025-07-27.at.15.13.39.mov(That package doesn’t currently support adding arbitrary content above the menu, like reactions, and I don’t have time right now to extend it myself.) That native menu style would be ideal - WhatsApp does exactly that, using the native context menu with a custom widget above for reactions. Since that’s not feasible at the moment, I think the second best option might be using something like family_bottom_sheet. It mimics the experience of apps like Slack or Discord, where both reactions and menus are presented in a unified bottom sheet. It’s inspired by Family, and I think it looks and feels really solid (I use it on https://flyer.chat). So I’m thinking - maybe we could move reactions + the menu into a bottom sheet for a better UI experience? The only possible downside is integration with the emoji picker - having two differently styled bottom sheets might feel weird. I’m not sure what level of customisation is available in the emoji picker, but if we can either embed it inside the family sheet or make it behave more like a keyboard (instead of a sheet), it should be fine. I see a few options:
Let me know your thoughts! |
Hello @demchenkoalex What do you mean by full native and what is the package you refer to? Also where does the your video comes from? There seems to be a Hero animation, which I removed for now, it was causing top many layouts issues during page transition. As per your bottom sheet proposition, why not, i leaned toward the current UX because that's the most common one in chat apps but Slack one is quite nice too. Regarding the picker we could simply pop the bottomSheet and let the use do as it pleases (same as I currently did, to no include the emoji package in our package). I think we can maybe:
I will have less time in the upcoming weeks but if it's "only" switching to the pull_down_button lib and exposing some parameters and fixing cursor analysis it should be fine (also maybe we should come up with a better name for the lib which does not only do reactions but it was the primary purpose) Let me know, we can chat on Discord sometimes (can email you my ID) if you wanna discuss this. |
Definitely, not sure if my email is visible anywhere, if not, you can send to [email protected] |
hello @demchenkoalex Made a test with I'm quite a noob in animation but should we want to animate how the menu appears it should be quite easy? The only drawback for me are
There is one remaining conversation open + i think we should expose the params as a configuration objects, it will make the code more robust, will give it a try tomorrow. |
77afe28
to
8b0c2e7
Compare
@demchenkoalex I'm done. I started working on Config classes but wanted to discuss it before to not pollute this PR. My idea was for example a |
Note
This is the follow up of PR #789 that had become quite unreadable due to lots of testing and iteration.
Objectve
The goal of this PR is to provide UI support for the reactions, which are already in the model.
UI wise my goal was to have something in the Signal/Whatsapp style, as opposed to the iMessage / getStream.io one. That is:
I made i customizable so the client can chose the behavior on reaction tap, long press ...
Dev goals
I did my best to:
IntrinsicWidth
to build the reactionsflutter_chat_ui
depend on this package.Integration
Row of reactions under the message
FlyerChatReactionsRow
widget with any logic he might want.LongPress action
The idea is to let the user decide when he wants to display the dialog.
The package exposes a
showReactionsDialog
methodWhat the lib does NOT do
ChatController
. It's up to the client do decide what to do. Some might want to allow multi react. Note the booleanremoveOrAddLocallyOnTap
allow to visually add/remove one on tap.What I add to change in the main lib
isSentByMe
to some callbacks_buildMessage
method (to rebuild the "inner" bubble in the dialog)Still todo?
removeOrAddLocallyOnTap
is true; or at least a splash effect?Video
Recording.at.2025-07-18.09.24.00.mp4
Shots
Web

MacOS