LemmyNet / lemmy

🐀 A link aggregator and forum for the fediverse
https://join-lemmy.org
GNU Affero General Public License v3.0
13.26k stars 881 forks source link

Hide deleted comments from the user profile #1053

Closed StaticallyTypedRice closed 2 years ago

StaticallyTypedRice commented 4 years ago

Is your proposal related to a problem?

Having a bunch of "comment deleted" placeholders in a user profile can be distracting, and it also kind of goes against the user's wishes by deleting the content. Also, Lemmy already hides deleted posts so why not deleted comments?

Describe the solution you'd like

I suggest not showing any deleted comments (or rather, deleted comment placeholders) on a user's profile.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/92333906-hide-deleted-comments-from-the-user-profile?utm_campaign=plugin&utm_content=tracker%2F126011972&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F126011972&utm_medium=issues&utm_source=github).
ba1ash commented 3 years ago

Hello @Nutomic, Is this issue still actual? If yes I will implement it.

dessalines commented 3 years ago

This would be a lemmy ui issue. But also the reason that comments are not hidden like posts, is that comments can have un hidden children.

Actually maybe not a ui issue? But probably just a no fix? Not sure

Nutomic commented 3 years ago

@dessalines This is about the user profile, so there is no comment tree shown. I think the fix would be essentially to add a parameter like show_deleted_and removed to CommentQueryBuilder::create(), and set that false in the location below.

https://github.com/LemmyNet/lemmy/blob/main/crates/api_crud/src/user/read.rs#L83

@ba1ash Please go ahead to implement this, and feel free to ask if anything is unclear.

kartikynwa commented 2 years ago

@Nutomic Is there still interest in this?

Nutomic commented 2 years ago

@kartikynwa Yes of course. If you need any help to implement it, feel free to ask here.

kartikynwa commented 2 years ago

@Nutomic

I am thinking:

In crates/api_common/src/person.rs , modify GetPersonDetails and add pub show_deleted_and_removed: Option<bool>.

In crates/db_views/src/comment_view.rs, modify CommentQuery and add show_deleted_and_removed: Option<bool>. In the list function, filter query by deleted=FALSE AND removed=FALSE if show_deleted_and_removed is Some(false).

In crates/api_crud/src/user/read.rs, add ..show_deleted_and_removed(data.show_deleted_and_removed) to the CommentQuery::builder() call.

Anything else that I am missing?

dessalines commented 2 years ago

@kartikynwa That seems correct to me. Let me know in the lemmydev matrix chat if you need any help.