Skip to content
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

Feature: Double-tap message to add 👍 reaction #969

Open
chrisbobbe opened this issue Sep 27, 2024 · 1 comment · May be fixed by #1307
Open

Feature: Double-tap message to add 👍 reaction #969

chrisbobbe opened this issue Sep 27, 2024 · 1 comment · May be fixed by #1307
Labels
a-msglist The message-list screen, except what's label:a-content
Milestone

Comments

@chrisbobbe
Copy link
Collaborator

chrisbobbe commented Sep 27, 2024

We've had a support request asking if we might implement double-tap to 👍 react in the Flutter app. Here's the message:

[…] I’d like to ask when the new flutter app would be production ready? And if it can have a double tap to thumbs-up feature. This use case happens incredibly often since my programmers are smart. So usually I just need to drop a hundred thumbs up on their messages to confirm the topic as well as show I’m there. Double tap for thumbs up on a message would simplify life a lot here

Discussion, which includes thoughts on whether this is a feature we'll want to offer. It should be helpful in any case to have this issue in the tracker.

Marking post-launch because this feature doesn't exist in the legacy apps.

@chrisbobbe chrisbobbe added the a-msglist The message-list screen, except what's label:a-content label Sep 27, 2024
@chrisbobbe chrisbobbe added this to the Post-launch milestone Sep 27, 2024
@chrisbobbe chrisbobbe changed the title Feature: Double-tap message to add ":+1:" reaction Feature: Double-tap message to add 👍 reaction Sep 27, 2024
@gnprice gnprice modified the milestones: M6: Post-launch, M7: Future Nov 21, 2024
@E-m-i-n-e-n-c-e
Copy link

Solved:

20250125-0900-02.5007496.mp4

I placed the double tap gesture in the same gesture detector that detects long press to open message action sheet. Reused the same logic that is being used to add or remove reactions in message action sheet. So it should handle all cases correctly

      onDoubleTap: () {
        // Access the PerAccountStore to get user-specific data.
        final store = PerAccountStoreWidget.of(context);
        // First emoji in popular Candidates is thumbs up
        final thumbsUpEmoji = EmojiStore.popularEmojiCandidates.toList()[0];
        // Check if the user has already reacted with thumbs up
        // Uses the same logic as hasSelfVote() in action_sheet.dart
        final isSelfVoted = message.reactions?.aggregated.any((reactionWithVotes) =>
          reactionWithVotes.reactionType == ReactionType.unicodeEmoji
          && reactionWithVotes.emojiCode == thumbsUpEmoji.emojiCode
          && reactionWithVotes.userIds.contains(store.selfUserId)) ?? false;

        // Get the localizations for the current context to display appropriate messages.
        final zulipLocalizations = ZulipLocalizations.of(context);

        // Call the function to add or remove the reaction based on the user's current state.
        doAddOrRemoveReaction(
          context: context,
          doRemoveReaction: isSelfVoted,
          messageId: message.id,
          emoji: thumbsUpEmoji,
          errorDialogTitle: isSelfVoted
            ? zulipLocalizations.errorReactionRemovingFailedTitle
            : zulipLocalizations.errorReactionAddingFailedTitle);
      },

E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 25, 2025
Add ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 25, 2025
Adds ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 25, 2025
Adds ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 25, 2025
Add ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 25, 2025
Add ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 25, 2025
Add ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Jan 27, 2025
Add ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
E-m-i-n-e-n-c-e added a commit to E-m-i-n-e-n-c-e/zulip-flutter that referenced this issue Feb 1, 2025
Add ability to double-tap messages to quickly add/remove 👍 reactions

Fixes zulip#969.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-msglist The message-list screen, except what's label:a-content
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants