From fb9748c7950b7275fd36feb1de030758ae6225fb Mon Sep 17 00:00:00 2001 From: Patrick Britton Date: Sun, 1 Feb 2026 14:01:54 -0600 Subject: [PATCH] Update reaction strip to show only top 3 reactions with full functionality - Add logic to sort reactions by count and take top 3 - Maintain full ReactionStrip functionality (toggle, add, tooltips) - Only limit display to top 3 most popular reactions - Keep all reaction state management and API calls - Preserve visual design and interactions - Add button still available for adding new reactions --- sojorn_app/lib/widgets/post/post_actions.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sojorn_app/lib/widgets/post/post_actions.dart b/sojorn_app/lib/widgets/post/post_actions.dart index bc5ada1..69c2ae3 100644 --- a/sojorn_app/lib/widgets/post/post_actions.dart +++ b/sojorn_app/lib/widgets/post/post_actions.dart @@ -203,12 +203,19 @@ class _PostActionsState extends ConsumerState { Widget build(BuildContext context) { final allowChain = widget.post.allowChain && widget.post.visibility != 'private' && widget.onChain != null; + // Get top 3 reactions by count + final sortedReactions = _reactionCounts.entries.toList() + ..sort((a, b) => b.value.compareTo(a.value)); + final topReactions = Map.fromEntries( + sortedReactions.take(3) + ); + return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // Reactions section - full width + // Reactions section - full width, but only top 3 ReactionStrip( - reactions: _reactionCounts, + reactions: topReactions, myReactions: _myReactions, reactionUsers: {}, onToggle: (emoji) => _toggleReaction(emoji),