Merged
Conversation
d1149eb to
7667f36
Compare
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.
PR #66 added some ways for moderators to blur, edit, wrap, replace or remove comments. However, there was no way to reverse a moderator action, and comment removal was not actually applied.
This PR introduces a
Restoremoderation action that undoes previous actions. To avoid having to destroy the history of moderation actions, the semantics are that only the latest moderation action can affect the appearance of the comment, so adding aRestoreaction after other actions will undo earlier changes in comment appearance, and it is possible to keep adding comments to re-apply appearance changes after a reset.Removed comments are rendered as an empty
articlestyled asdisplay: noneunless the authenticated user is a moderator, in which case we show the removal comment similar to the replacement comment, but with a red border. We could also add a text indication or badge as the red border is not particularly noticeable.Rendering an empty, non-displayable
articleelement seems to help livewire correctly manage content morphing for the comment list: however, it may be possible to just omit the element entirely.The PR also tidies up some unnecessary files committed in #66.
In the demo video, the comments show moderated appearances, including one that is actually not visible because it has been removed. After logging in as a moderator, it is possible to see the removed comment and to undo earlier actions by creating a comment to
restorethe original comment.