Skip to content

feat(ui): add onReactionLongPress reporting the long-pressed reaction - #2903

Open
xsahil03x wants to merge 3 commits into
masterfrom
sahil/flu-706-reaction-long-press
Open

feat(ui): add onReactionLongPress reporting the long-pressed reaction#2903
xsahil03x wants to merge 3 commits into
masterfrom
sahil/flu-706-reaction-long-press

Conversation

@xsahil03x

@xsahil03x xsahil03x commented Aug 17, 2026

Copy link
Copy Markdown
Member

Closes FLU-706.

Adds onReactionLongPress to StreamMessageItem and StreamMessageListView, reporting which reaction was long-pressed so apps can open a reactions bottom sheet showing everyone who reacted.

Mirrors the onReactionTap plumbing 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_flutter is pinned to 91a16b2 — the commit on that PR's branch — in melos.yaml, packages/stream_chat_flutter/pubspec.yaml, and docs/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

  • OnReactionLongPress typedef + ReactionLongPressDetails (message + reaction) in typedefs.dart.
  • Threaded through StreamMessageListViewStreamMessageItem (+ props and copyWith) → StreamMessageContentStreamMessageReactions → core StreamReactions.
  • The reaction is null for 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 resolution onReactionTap uses.

No default, on purpose

The reaction chips sit inside the message row's long-press InkWell that opens the actions modal, so a chip-level recognizer wins its hit area. onReactionLongPress therefore has no default arm: left null, null is 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.

(onReactionTap needs no such care — tap already had a default, opening the reaction detail sheet.)

Testing

  • 5 new tests in stream_message_reactions_test.dart: segmented reporting, own-reaction vs. synthesized, overflow → null, cluster → null, and no recognizer when the callback is null.
  • 2 new tests in stream_message_item_test.dart pinning 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 test clean; 1242 tests pass. The 2 stream_message_deleted golden failures are pre-existing on master (verified against a clean checkout).

🤖 Generated with Claude Code

xsahil03x and others added 2 commits August 17, 2026 17:32
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>
@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

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

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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
xsahil03x marked this pull request as ready for review August 17, 2026 15:44
@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 73.97%. Comparing base (e75c553) to head (98c57d4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...er/lib/src/message_widget/stream_message_item.dart 66.66% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant