Codelabz icon indicating copy to clipboard operation
Codelabz copied to clipboard

Feature: Enhance comment section and connect the upvote/downvote actions to backend

Open Ashish-Ranjan007 opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

  1. Same button is used to display replies for a comment and a field to add a reply.
  2. No way to close the reply field once it is opened.
  3. All the replies on a comment are displayed at once unlike in comments where only 3 are shown and a load more option is provided.
  4. Username is not displayed on the comment.
  5. While creating a comment a static value called codelabzuser is used instead of current user handle.
  6. Upvotes/Downvotes are mere increment/decrement functions that are not connected to the backend.
  7. One user can upvote/downvote a comment infinitely.

Describe the solution you'd like

  1. reply button will continue to display the reply input field, but a different button show replies will be added which will display the replies on a comment.
  2. show replies and reply buttons would toggle display/hide state of replies and input reply field.
  3. Display only 3 replies at once and a button load more is added to display more replies if they exist.
  4. Display username on the comment to let users know who posted that comment.
  5. userId of the current user should be provided while creating a new comment instead of a static value.
  6. Three new fields should be added to comments collection namely totalUpvotes, isUpvotedBy, isDownvotedBy, where totalUpvotes is an integer which stores the net upvotes of a comment and isUpvotedBy and isDownvotedBy are two arrays which store IDs of users that upvote or downvote it. So, when a user upvotes a comment their ID is stored in isUpvotedBy array of that comment and totalUpvotes is increased and vice versa.
  7. User can only upvote or downvote once.

Additional context https://github.com/scorelab/Codelabz/assets/58631166/89472f5b-e15a-4669-a78c-ec9433852cd2

Ashish-Ranjan007 avatar Jan 03 '24 10:01 Ashish-Ranjan007

@shivareddy6 @ABHISHEK-PANDEY2 Hi, can I be assigned to work on this issue?

Ashish-Ranjan007 avatar Jan 03 '24 10:01 Ashish-Ranjan007

@shivareddy6 @ABHISHEK-PANDEY2 i am already working on the similar issue which covers this can i add more towards this i would like you to assign me

Huzaif-Ahmed avatar Jan 03 '24 10:01 Huzaif-Ahmed

@Huzaif-Ahmed Hi, can you point me to the issue you are working on?

Ashish-Ranjan007 avatar Jan 03 '24 10:01 Ashish-Ranjan007

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Feb 03 '24 02:02 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 13 '24 02:05 github-actions[bot]