Merged
Conversation
Collaborator
|
I've gone ahead and merged this. Can/should/do we set up a "default" user with moderator privileges that would make it more straightforward to road-test these changes in the staging environment? |
Collaborator
Author
|
Yes! I thought there might be some already that I don't know about, but we can add some! We could set up some accounts with known passwords, or for specific emails, and then they could use a password reset. |
Collaborator
|
let's double back with kirk on this once he's back in the saddle -- we do have a dummy "guest" account, and could maybe do a similar dummy "moderator" account with a default password we keep semi-private via the discord? |
This was referenced Jul 27, 2025
Merged
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We want to support moderation of comments (and likely posts): currently it is possible to edit comments, but there are no easy ways to replace or hide comments in a way that requires a click-through.
This PR adds a
moderation_typetocommentswith the intent that moderation actions can be thought of similarly to replies to comments, in that they are part of the overall conversation and can themselves be moderated or revised. The difference to regular replies is in how these comments affect the rendering of the original comment. The different effects are captured in theModerationTypeEnum:blur- the original comment appears blurred out, optionally with a message overlaid, and clicking it will reveal the blurred comment underneath. The rendered HTML contains the full comment - the blurring just affects the client-side visibility.comment- the moderator reply shows as other replies would appear, but has a special border or other appearance indicators to show that it is a moderator acting in their capacity as a moderator, not just as a community member.edit- the moderator combines an edit of the original comment body with their own explanatory message that may be shown underneath the original comment.remove- the moderator completely removes the comment from display and rendering in the HTML, without providing any replacement.replace- the moderator completely removes the original comment body from display and rendering in the HTML, and replaces it's original position with a moderator comment.wrap- the moderator hides the original comment behind a disclosure arrow (detailselement) that can be toggled to show/hide the original comment. The original comment is still available in the HTML.To make some of these changes have the intended effect, i.e. that removed / replaced comment bodies are not even rendered to the HTML, and to also avoid shenanigans where clients modify backend state in unexpected ways, this PR includes a lot of changes to the attributes actually round-tripped to the client with Livewire. We now mostly just send the comment id, which is marked as
#[Locked], and is used to refetch the comment from the database, rather than trusting the snapshot returned from the client. This also reduces some of the duplication inwire:snapshotattributes.This PR builds on the
comment-flaggingbranch from #60: here is a diff against that branch.Mini demo!