incubator-answer icon indicating copy to clipboard operation
incubator-answer copied to clipboard

Add reactions to question & answer

Open fenbox opened this issue 1 year ago • 8 comments

Summary

We are thinking about adding a reaction feature to:

  1. Increase interaction among users
  2. Reduce meaningless comments.

This is because the community's voting system has reputation thresholds and limited usage scenarios. Reactions will not affect reputation.

Description

Task 1

  • [ ] Change "Add a comment" button style, like btn-light with small size and pill style

image

Task 2

  • [ ] Add reactions

image

Rules

  • All actived user can add reaction, like github issue.
  • Reaction include:
    • Emoji: heart, smile, frown
    • Response count: Users who added on that emoji
  • When moving to an existing reaction, show which people clicked on that emoji, display the first 5 users and "{{n}} more..." for the rest.
  • When clicking on an existing emoji, that emoji +1.
  • Clicking on the + shows available emojis to choose from, and selecting one will increase that reaction count by 1.
  • No need for system notifications.
  • Reaction does not affect reputation.

Design files

image

fenbox avatar Mar 27 '24 10:03 fenbox

Hi @fenbox , I'd like to try this task, thx!

hgaol avatar Apr 23 '24 07:04 hgaol

@hgaol Great, I will add more details for development.

fenbox avatar Apr 23 '24 08:04 fenbox

About the backend logic, I saw there's meta table and the object_id column could represent both answer and question. Is it suitable for such scenario? e.g. key is object.reaction.count, and value is something like {"heart": 1, "smile": 1, "frown": 1}.

Another option is add additional columns in question and answer tables with these 3 columns, while I don't think altering table is a good thing and it looks little redundant.

Pls let me know if any comment or suggestion, thx! @LinkinStars


nvm, I forgot it also should show the names. Let me take a look at the latest designs and find if any question.

hgaol avatar Apr 23 '24 15:04 hgaol

Hi @fenbox , I'd like to try this task, thx!

@hgaol I've updated the details and links to the designs. Please let me know if you have any questions.

fenbox avatar Apr 24 '24 05:04 fenbox

Hi @LinkinStars , below is my thought in database design. Pls let me know if any comment or suggestion. thx!

About the backend logic, I saw there's meta table and the object_id column could represent both answer and question. Is it suitable for such scenario? e.g. key is object.react.summary, and value is something like {"heart": [1,2,3], "smile": [3,4,5], "frown": [5,6,7]}. Here the int array represents the user ids reacted to this emoji.

hgaol avatar Apr 28 '24 08:04 hgaol

Hi @LinkinStars , below is my thought in database design. Pls let me know if any comment or suggestion. thx!

About the backend logic, I saw there's meta table and the object_id column could represent both answer and question. Is it suitable for such scenario? e.g. key is object.react.summary, and value is something like {"heart": [1,2,3], "smile": [3,4,5], "frown": [5,6,7]}. Here the int array represents the user ids reacted to this emoji.

@hgaol It's great. The meta table is used to hold other data related to the object. It is appropriate to use it here.

LinkinStars avatar Apr 28 '24 08:04 LinkinStars

Hi @fenbox , should it support i18n? e.g. what the Chinese version should be for smile, heart and frown?

hgaol avatar May 07 '24 03:05 hgaol

Hi @fenbox , should it support i18n? e.g. what the Chinese version should be for smile, heart and frown?

Yes.

simle -> 笑脸 heart -> 爱心 frown -> 难过

fenbox avatar May 07 '24 03:05 fenbox