#3246 Add comment reactions
Merged by pingou. Opened by lsedlar.
lsedlar/pagure reactions  into  master

Download 3246.patch

A user can select from a predefined list of reactions for a comment. There can be multiple reactions from the same person on a single comment, but only one of each type.

Fixes: https://pagure.io/pagure/issue/812

Let's use the full name: reaction

We'll need to adjust this ;-)

Is this way of storing the reactions reasonable?

Looks fine to me :)

If it used user ids instead, it could display up-to-date name. But if a user is deleted, it would be more tricky. (Can a user be deleted? What happens to their comments then?)

Let's rely on username, then there is no need to update anything. Also, we can "fix" this by not listing all the usernames, imagine if 100 people react on 1 comment... :)

Is a predefined list of reactions good enough? Or should it support any emoji as suggested by @jflory7?

How hard would it be to change? Emoji support is tempting but I'm seeing our competitor is offering only 1 reaction/user in a restricted set.

Should only one reaction per comment per user be allowed?

See above, open to more suggestions :)

Thanks for the feedback!

How hard would it be to change? Emoji support is tempting but I'm seeing our competitor is offering only 1 reaction/user in a restricted set.

It should be doable. I just need to figure out how to put the autocomplete field into the dropdown in a reasonable way. I'll try to get something working over the weekend.

I'm not sure if multiple reactions from the same user are a good thing. If it's used for voting, some could fake multiple votes by using different emoji (:thumbsup: :100: :heart: :hearts: :heartbeat: :heartpulse: :two_hearts:).

rebased onto 6a6c36c34af3c389f4050c8ff856e3d78a972a7b

Updated to support any emoji as reaction. There is still a predefined list for easy access (I wouldn't want to type the name all the time). One user can send multiple reactions to one comment. Only 10 people for each reaction should be displayed.

Further issues to resolve:

  • make it work for pull request comments
  • the emoji selector dropdown is displayed below the search entry
  • write some tests
  • try and make it look more polished

Not working and I think it's fine:

  • reactions are not updated live via SSE; users must refresh page
  • reaction added via javascript do not get username of current user in the tooltip

rebased onto 7924676a7b6d1f8f3296b359d008991ecf0820f5

Metadata Update from @pingou:
- Request assigned

Metadata Update from @pingou:
- Request reset

5 new commits added

  • Move common js into a separate file
  • Add reactions to pull request comments
  • Move emoji dropdown above search entry
  • Less space around reaction buttons
  • Prettier button

Now it works for pull request comments as well.

Now only tests are missing.

is the idea here to have a set of reactions? or just let a user do any emoji?

If any emoji, what is the difference between a reaction, and just adding an emoji as a comment. /me is kinda leaning towards having a subset of reactions rather than any emoji (which also could be bad for community -- :poop: )

Originally I started with a set of allowed reactions, then extended it into allowing any emoji. Even if that is allowed, I would want to keep a select few easily accessible.

I'm starting to think that any emoji is not a good idea because it causes a few issues: the way it works now emojione only gives us the code for the symbol, not any name. Therefore it's rather inaccessible, as the best textual representation we can do is something like 1F4A9. With a selected list we could know that is actually a pile of poop. This is problematic for vision impaired users and also for exposure in the API.

If any emoji, what is the difference between a reaction, and just adding an emoji as a comment.

Right now the difference is that e-mails are not sent for reactions (probably good), it will not show up in the heatmap on user page (probably should be fixed), and it will display differently. Otherwise no difference.

rebased onto 4fe90bcb7b0748dfda239193bc84020a8c0bfdf5

rebased onto 0124c8b70b01d67f251a5afbbffa6600c6fcc9d8

Changes since last version:

  • there are tests now :smile:
  • I removed the arbitrary emoji picker again
  • which enabled exposing the reactions via API

rebased onto c22b77ad7550a9eb931890acd4af4e7c1a2fcc36

The current code doesn't work for me, it looks like the CSRF is missing from the http call

rebased onto 593b46270b68abd7a03822b568ad6fa9d4038c08

CSRF token is now fixed.

rebased onto 23776650661f207cb4f560d4f3f5256c9d531fa8

Looks like the tests aren't passing :(

Yes, I'll resolve that today evening.

I'm running them right now :)

rebased onto 811999a0b44165081dd83d342546ad36d752ea9e

Pretty please pagure-ci rebuild

rebased onto 59889e509dd5d34f09c0b5edc52af0fd36b2ccdf

rebased onto 59889e509dd5d34f09c0b5edc52af0fd36b2ccdf

Pretty please pagure-ci rebuild

2 new commits added

  • Fix formatting to conform to line length limit
  • Add comment reactions

One more attempt...

Pretty please pagure-ci rebuild

Locally the tests are finally passing :)

And they pass here too!

:thumbsup: :100:

Pull-Request has been merged by pingou

Metadata