Reactions menu displaying outside of post action undo window (mobile)

AI-generated summary

Users are reporting an issue where the reactions menu displays outside of the post action undo window on mobile, despite the user being unable to change their reaction. jidanni encountered this issue when trying to change a thumbs up to a heart after 13 minutes, and JammyDodger was able to reproduce it on mobile.

On desktop, an error message is displayed when trying to remove a reaction after the time limit, but on mobile, the reactions menu is unresponsive and does not provide an error message. Arkshine investigated the issue and found that there is a check for clicks, but not for touches, which may be the cause of the problem.

jidanni suggested that the error message should include the time limit to inform users of the restriction. piffy shared that they changed their site’s default setting to allow liking/unliking at any time, which may be a possible solution to this issue.

On https://community.openstreetmap.org/
I made a thumbs up. Then 13 minutes later I came back and wanted to change it to a heart. Okay I got this far as you see. But I can’t change it to a heart. Okay let’s say there’s that 10-minute rule that you can’t change anything after that. Well in that case my point is then you shouldn’t show us the list of icons that we can change it into because we can’t use any of them.

In other words when I tap the thumb again, in order to change it into something else, then the best thing is I should get no response, and not be shown a list of choices, that I cannot use.

Even better would be, when I tap the thumb again, a message should pop up, explaining that I can’t change my choice because 10 minutes are up.

Why am I posting here on meta instead of on that local site? Because I’m talking about a problem that affects all sites that give such a choice.

1 Like

Oh yes, I can repro this on mobile (Android/Chrome). I don’t think it used to do that, so it may be a regression of some kind.

On desktop you get a :no_entry_sign: and a hover text of ‘You can no longer remove your reaction’.

Step-by-step: (on mobile)

  • Enable Reactions
  • Set post undo action window mins to 1 (optional)
  • React to a post and wait N minutes
  • Longpress on the Reaction icon
  • Reaction menu displays even though the ability to React or remove Reaction is not possible
  • Menu is unresponsive and no error is given
3 Likes

I could not find in history what could be a regression.

There is a check for the click in toggleFromButton:

https://github.com/discourse/discourse-reactions/blob/main/assets/javascripts/discourse/widgets/discourse-reactions-actions.js#L430-L435

But not for the touch:
https://github.com/discourse/discourse-reactions/blob/main/assets/javascripts/discourse/widgets/discourse-reactions-actions.js#L170-L183

I guess you could do the following not to open the reactions list:

  touchStart() {
    cancel(this._touchTimeout);
    if (this.capabilities.touch) {
      if (
        this.attrs.post.current_user_reaction &&
        !this.attrs.post.current_user_reaction.can_undo
      ) {
        return false;
      }
      ...
}
3 Likes

By the way it’s good to tell the user he can’t remove his reaction but you might as well also mention the time limit otherwise the user can’t tell if it’s a day or a month or a minute or whatever. The only way for him to find out is trial and error!

2 Likes

I found the time limit for liking a very unusual default setting and was one of the first things I changed (to like/unlike freely at any time) fwiw

3 Likes