Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a Comment With Child Comments Removes SubTree #174

Open
gordonbanderson opened this issue Feb 14, 2016 · 5 comments
Open

Deleting a Comment With Child Comments Removes SubTree #174

gordonbanderson opened this issue Feb 14, 2016 · 5 comments

Comments

@gordonbanderson
Copy link
Contributor

Change to add a flag 'MarkedAsDeleted' and render a message likes of 'this comment was deleted by an administrator'.

A spam comment with children should probably be treated similarly though I guess the message will be different for an admin (who can see the comment to ham it) and someone without admin rights who would see likes of 'this comment was marked as spam by an administrator'

@tractorcow
Copy link
Contributor

We'll need to build in a new status, but it's probably fine; Maybe a "ShowDeleted" status flag?

And also a config option to toggle between "real" delete and "show deleted".

@gordonbanderson
Copy link
Contributor Author

I went with 'MarkedAsDeleted' but easy enough to change. When writing tests I realize there are some interesting interface implications. For example if a comment which is marked as deleted has a valid child comment, and the child is deleted, the child and the parent should both be removed. And this of course could cascade up the hierarchy if there is a long ancestry of marked as deleted comments with a valid child comment. Edge case but one to consider. And then of course there is the admin interface...

@gordonbanderson
Copy link
Contributor Author

Just testing on master with the admin section, with a parent and child comment, deleting the parent deletes both parent and child.

@gordonbanderson
Copy link
Contributor Author

Given the number of configuration options for this module I'm reluctant to add more unless we have to. I'm not sure that what you refer to as 'real delete' is a good idea, at the very least a confirmation step for non JS users is required, otherwise a whole subtree of comments will disappear.

One other possibility is to present the admin with both options, namely 'Mark this as deleted' and 'Delete this comment and descendants' (that needs better phrasing). For a comment that is a leaf on a tree, just present a delete button as is now.

@gordonbanderson
Copy link
Contributor Author

I had a chance to think about this over a 5km jog earlier. My thinking is that the there should be no deletion of the subtree unless explicitly stated in the interface. This suggests the following:

  • In the admin cms interface only one comment is deleted. This makes perfect sense as the comments are represented linearly.
  • In the front end a Delete button is presented for both leaves and non leaves. On a leaf this deletes a comment. When the comment is a non leaf in the tree show the delete button but also an optional tick box to delete descendant comments.

In the case of comments that are not nested things are as they were before. Best solution I can think of

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants