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

Reactions #553

Merged
merged 31 commits into from
Oct 4, 2021
Merged

Reactions #553

merged 31 commits into from
Oct 4, 2021

Conversation

luap42
Copy link
Member

@luap42 luap42 commented Jul 11, 2021

Implementing my proposal from https://meta.codidact.com/posts/277957, this pull request adds reactions to QPixel. Reactions are in many ways similar to votes, but they provide a more specific meaning than that a post is good or is bad. The set of available reactions can be edited on a per-site basis, but this PR includes the following as an -- in my opinion -- reasonable default:

  • Works for Me
  • Outdated
  • Dangerous

These reactions are examples of good reaction types, because they provide meaningful information to the reader (this post has been confirmed to be working, this post might be outdated and therefore not the proper solution for your specific problem and this post's proposal is dangerous and should be adopted with care and only if you have sufficient knowledge). They are not just an other way to up- or downvote a post. For example, an outdated post might still be worth an upvote if the proposal in it is good, just for a deprecated version of a tool or framework.

Reactions are shown right above a post, clicking on them opens a modal dialog with more information, including who reacted and if they wrote a comment an excerpt of and a link to of that too.

a "Works for me" reaction by two users above a post

the details modal for the previous reaction showing that the second user added a comment

While reactions lower the bar to give feedback and while they make feedback of some types more prominent, they are also not supposed to be a replacement for comments. Therefore they are closely integrated into comment threads. The reaction creation dialog allows you to additionally post a comment; some reactions might also require a comment to be posted (activated by default for the Dangerous reaction).

Reactions can be added by clicking a button below the voting buttons; this will open an drop panel allowing you to select reactions, adding (optionally) a comment and then submitting them. If you already have a reaction of one type, you can retract it from there:

image of the panel described above

Moderators of any site can edit the list of reaction types available on this site. However deleting reactions will be reserved for administrators as it will cascade to all added reactions by users and therefore being an irreversible, destructive action:

moderator dashboard


Basic functionality has been completed, what's making this PR work in progress is:

  • editing, adding and deleting reaction types
  • testing

@luap42 luap42 added area: ruby Changes to server-side code area: html/css/js Changes to front-end code status: in progress This is being worked on labels Jul 11, 2021
@cellio
Copy link
Member

cellio commented Jul 11, 2021

Looking good so far! (Based on the description and screenshots here, not code inspection. :-) ) Some questions/thoughts:

  • I like that the "react" link is downplayed a little -- below the (larger) voting buttons. Should leaving a reaction prompt the user to cast a vote in some cases? You said this is dangerous -- don't forget you can downvote, or you said this works, don't forget you can upvote. I don't think we want to require a vote in order to react (for example, out of date isn't necessarily bad, just out of date), but people have raised concerns about reactions impeding votes, so it's something we should watch for.

  • Showing the timestamps on the reactions is very helpful, thanks. What else can we do to provide a signal when a post was edited after a reaction was made? What do you think about indicating the revision number a reaction applied to (with history link), with "current" where there hasn't been an edit?

@MoshiKoi
Copy link
Member

Are reaction types tied to post types? A community might want to have different reactions on different post types, e.g. Code Golf might want to have a set for Q&A posts and a separate set for Challenge Answer posts.

@luap42
Copy link
Member Author

luap42 commented Aug 27, 2021

Tests yet missing, besides that ready for review.

@luap42 luap42 marked this pull request as ready for review August 27, 2021 16:00
app/assets/javascripts/reactions.js Outdated Show resolved Hide resolved
app/assets/javascripts/reactions.js Outdated Show resolved Hide resolved
app/assets/javascripts/reactions.js Outdated Show resolved Hide resolved
app/controllers/reactions_controller.rb Outdated Show resolved Hide resolved
app/controllers/reactions_controller.rb Outdated Show resolved Hide resolved
app/views/reactions/_list.html.erb Outdated Show resolved Hide resolved
app/views/reactions/edit.html.erb Outdated Show resolved Hide resolved
app/views/reactions/new.html.erb Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
db/schema.rb Outdated Show resolved Hide resolved
@luap42 luap42 requested a review from ArtOfCode- August 27, 2021 20:43
@luap42 luap42 added status: completed This has been completed and removed status: in progress This is being worked on labels Oct 3, 2021
@ArtOfCode- ArtOfCode- merged commit 7c4841d into develop Oct 4, 2021
@ArtOfCode- ArtOfCode- deleted the luap42/reactions branch October 4, 2021 11:55
@luap42 luap42 mentioned this pull request Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: html/css/js Changes to front-end code area: ruby Changes to server-side code status: completed This has been completed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants