Skip to content

Allow restoring comments#67

Merged
csebianlander merged 1 commit intomainfrom
more-post-tools
Jul 27, 2025
Merged

Allow restoring comments#67
csebianlander merged 1 commit intomainfrom
more-post-tools

Conversation

@wrose504
Copy link
Collaborator

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 Restore moderation 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 a Restore action 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 article styled as display: none unless 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 article element 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 restore the original comment.

more post tools

@wrose504 wrose504 self-assigned this Jul 27, 2025
@csebianlander csebianlander merged commit 2e12de6 into main Jul 27, 2025
1 check passed
@wrose504 wrose504 deleted the more-post-tools branch July 27, 2025 20:57
@wrose504 wrose504 mentioned this pull request Jul 29, 2025
@wrose504 wrose504 mentioned this pull request Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants