incubator-answer
incubator-answer copied to clipboard
Add reactions to question & answer
Summary
We are thinking about adding a reaction feature to:
- Increase interaction among users
- 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-lightwith small size and pill style
Task 2
- [ ] Add reactions
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
- Figma
- CoDesign, PWD: 7XXV
Hi @fenbox , I'd like to try this task, thx!
@hgaol Great, I will add more details for development.
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.
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.
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.
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
metatable and theobject_idcolumn could represent both answer and question. Is it suitable for such scenario? e.g. key isobject.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.
Hi @fenbox , should it support i18n? e.g. what the Chinese version should be for smile, heart and frown?
Hi @fenbox , should it support i18n? e.g. what the Chinese version should be for
smile,heartandfrown?
Yes.
simle -> 笑脸
heart -> 爱心
frown -> 难过