Hide deleted comments unless they're needed for context
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Wishlist
|
Aaron Wells |
Bug Description
Currently when you delete a comment in Mahara, we leave a placeholder on the page that says "Comment deleted" and shows who made the comment. The idea behind this was to provide some context for subsequent comments, to indicate that people were responding to something which is no longer present.
However, this gets annoying in some cases. For instance, deletion of spam comments, or comments that were placed accidentally.
So, a compromise solution is to only display the placeholder if it's necessary for context. Specifically, if a comment is the last one on a page when it gets deleted, then we don't need to display its placeholder. Or if threaded comments are enabled, and a comment is the last one in its thread, we don't need to display its placeholder.
This should be applied recursively, so that if I delete the penultimate comment on the page, and then the last comment on the page, both wind up hidden. The comments should still be retained in the database for auditing purposes.
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
Because this behavior is dependent on the state of things at the time the comment is deleted, we can't calculate it as an emergent property of the existing data fields on the artefacts. So, we'll need to add an additional "hidden" column to artefact_ comment_ comment to track whether a comment should be hidden or not.
Hopefully having separate "hidden" and "deletedby" columns won't be too confusing for future developers.