Starting today, post authors and site admins have the ability to lock discussions on posts to prevent comments from being added.
Motivation
This feature is designed for both user safety and to allow authors the ability to manage the conversations happening under their own post.
It's our hope that providing authors and admins the ability to lock discussions will help relieve instances where "piling on" occurs in the comments section β e.g. think of those times where you've seen someone criticize an author for X and then lots of other folks comment inline to agree with and restate the criticism. Criticism isn't inherently bad of course, but when criticism is particularly biting and lots of people are joining in to repeat it, it can be excessive and unnecessarily hurtful. It can often set a pretty terrible tone and misplace the focus. We think it's totally reasonable for an author to lock a discussion when this happens.
We also believe this feature will be helpful to authors who want to post something particularly sensitive and would prefer for there not to be a discussion on the topic at all. We can definitely empathize with this decision and want to give authors that option.
We understand that it's possible a user might try to wield this ability to shield themselves from criticism. It is definitely not our intention to give authors a free pass to write anything they please without reserve. If we discover a user is misusing this feature on DEV to release Conduct-breaking material, we will act accordingly to hold the user accountable.
We're excited for you all to use this feature and hope that you'll share your feedback in the comments below.
How it works
To lock a discussion on a post, navigate to the Manage section of one of your posts. There are 3 ways to get there after you sign in:
- Append
/manage
to the URL of your post. - Visit your dashboard and click the Manage button next to the post you'd like to modify: .
- Visit your post and click the Manage button:
Locking a discussion
Once you're on the Manage page, you'll see the standard actions with a new button added that says Lock discussion:
Clicking that button takes you to a confirmation page:
As noted on the confirmation page, users will not be able to add new comments when a discussion is locked, but locking a discussion does not remove existing comments.
When locking a discussion, you can provide additional context:
- reason - this will be displayed publicly on the post once you lock the discussion (see below). This is optional.
- notes - this is only visible by the post author and admins. It is not publicly visible. This is optional.
Clicking Lock discussion confirms it. When you navigate back to your post, you'll see the discussion is locked and the reason will display, if you added one:
Unlocking a discussion
You also have the ability to unlock a discussion. To do this, repeat the first few steps above to navigate to the Manage page.
For a post that has its discussion locked, you'll now see a button that says Unlock discussion:
You'll be taken to a confirmation page where you'll also see the reason and notes that you originally put on the discussion lock:
Click Unlock discussion and your audience is able to leave comments on your post again π
How We Built It
Check out this PR to see how this feature was built:
Create DiscussionLocks #13905
What type of PR is this? (check all applicable)
- [x] Feature
Description
This PR introduces functionality to allow article authors, admins, and super admins to lock discussions which basically prevents the ability for users to add any further comments to an article. We've also added some logic to allow a permitted user to include a reason
that will display publicly when a discussion is locked and notes
which are only visible to users permitted to lock the discussion.
Related Tickets & Documents
closes https://github.com/forem/forem/issues/9619
QA Instructions, Screenshots, Recordings
- Pull down this code.
- Fire up the Rails server locally -
bin/startup
. - Login.
- Write a post.
- Go to
/manage
on your published post. - Click
Lock discussion
. - Add a
reason
andnotes
. - Lock the discussion.
- View your article - you should see the discussion is locked and you're unable to add a comment.
- Go back to
/manage
on your post. - Unlock the discussion.
- Go back to your post and leave a comment.
Post with discussion locked (with reason)
Post with discussion locked (without reason)
Added tests?
- [x] Yes
[Forem core team only] How will this change be communicated?
- [x] I'm not sure how best to communicate this change and need help
Top comments (4)
Great job Alex!
Now you can lock this discussion :P
Thanks for this write-up @alex and @michaeltharrington ! As a Forem admin I'm happy to have another tool to make our Forems safer for our users π
This is such a well thought out feature. Tremendous work @alex .
Awesome job @alex !!