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

Add reactions to question & answer #883

Open
2 tasks
fenbox opened this issue Mar 27, 2024 · 8 comments
Open
2 tasks

Add reactions to question & answer #883

fenbox opened this issue Mar 27, 2024 · 8 comments
Assignees
Labels
feature New feature request

Comments

@fenbox
Copy link
Member

fenbox commented Mar 27, 2024

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 fenbox added the feature New feature request label Mar 27, 2024
@hgaol
Copy link
Contributor

hgaol commented Apr 23, 2024

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

@fenbox
Copy link
Member Author

fenbox commented Apr 23, 2024

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

@hgaol
Copy link
Contributor

hgaol commented Apr 23, 2024

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.

@fenbox
Copy link
Member Author

fenbox commented Apr 24, 2024

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.

@hgaol
Copy link
Contributor

hgaol commented Apr 28, 2024

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.

@LinkinStars
Copy link
Member

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.

@hgaol
Copy link
Contributor

hgaol commented May 7, 2024

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

@fenbox
Copy link
Member Author

fenbox commented May 7, 2024

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

Yes.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
Status: Todo
Development

No branches or pull requests

3 participants