feat(ui): add onReactionLongPress reporting the long-pressed reaction - #2903
Open
xsahil03x wants to merge 3 commits into
Open
feat(ui): add onReactionLongPress reporting the long-pressed reaction#2903xsahil03x wants to merge 3 commits into
xsahil03x wants to merge 3 commits into
Conversation
Adds a per-reaction long-press callback to StreamMessageItem and StreamMessageListView, reporting the message's BuildContext and a ReactionLongPressDetails so apps can open a reactions sheet. Left null, the chips register no long-press gesture, so the message's own long-press handling (the actions modal) keeps working as before. Points stream_core_flutter at a local path dep for the matching core change; swap back to a git ref before merging. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The chips sit inside the message row's own long-press InkWell, so both recognizers compete. Assert the chip wins when onReactionLongPress is set, and that the message long press still fires when it is not. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later. 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 |
Swaps the local path dep for the commit ref on the core branch so CI can resolve it. Re-point at a merged SHA once GetStream/stream-core-flutter#153 lands. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
xsahil03x
marked this pull request as ready for review
August 17, 2026 15:44
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2903 +/- ##
=======================================
Coverage 73.96% 73.97%
=======================================
Files 435 435
Lines 28149 28158 +9
=======================================
+ Hits 20821 20830 +9
Misses 7328 7328 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes FLU-706.
Adds
onReactionLongPresstoStreamMessageItemandStreamMessageListView, reporting which reaction was long-pressed so apps can open a reactions bottom sheet showing everyone who reacted.Mirrors the
onReactionTapplumbing from #2852, minus the deprecation machinery — this replaces no existing API, so it is purely additive.Depends on GetStream/stream-core-flutter#153
stream_core_flutteris pinned to91a16b2— the commit on that PR's branch — inmelos.yaml,packages/stream_chat_flutter/pubspec.yaml, anddocs/docs_screenshots/pubspec.yaml, so CI can resolve it. Re-point all three at a merged SHA once the core PR lands, then merge this.What changed
OnReactionLongPresstypedef +ReactionLongPressDetails(message + reaction) intypedefs.dart.StreamMessageListView→StreamMessageItem(+ props andcopyWith) →StreamMessageContent→StreamMessageReactions→ coreStreamReactions.nullfor a clustered or overflow chip that maps to no single reaction; an own reaction is reported verbatim, otherwise one is synthesized from the resolver's emoji code — same resolutiononReactionTapuses.No default, on purpose
The reaction chips sit inside the message row's long-press
InkWellthat opens the actions modal, so a chip-level recognizer wins its hit area.onReactionLongPresstherefore has no default arm: left null,nullis threaded all the way down, no recognizer is registered, and long-pressing a chip keeps opening the actions modal exactly as before. Existing apps are unaffected whether or not they adopt the callback.(
onReactionTapneeds no such care — tap already had a default, opening the reaction detail sheet.)Testing
stream_message_reactions_test.dart: segmented reporting, own-reaction vs. synthesized, overflow →null, cluster →null, and no recognizer when the callback is null.stream_message_item_test.dartpinning the gesture arena outcome on the fully composed item: the chip wins when the callback is set, and the message long press still fires when it is not.dart analyze --fatal-infos lib testclean; 1242 tests pass. The 2stream_message_deletedgolden failures are pre-existing onmaster(verified against a clean checkout).🤖 Generated with Claude Code