FEATURE: Allow user to delete their pending topic/post at activity page

The /activity/pending currently lists all pending topics/posts, but only posts can be deleted when entering the topic and click “Delete” button under the “waiting for approval” box, and users can’t delete their pending topics themselves without contacting a staff.

This commit add a similar “Delete” button directly to the /activity/pending page, so that users can delete their pending topics themselves, following a similar logic as the deletion of pending posts before.

Before:

After:

Also added some specs to test this function.

2 לייקים

Looks cool! Just as some thoughts..

  • how come the deleted topic stays in the queue like in your screenshot? shouldn’t it just.. cancel it?
  • it would make sense to me for a confirm prompt instead of making a destructive action one click
2 לייקים

how come the deleted topic stays in the queue like in your screenshot? shouldn’t it just.. cancel it?

The logic is kept the same as that of a post, i.e., when a post is deleted by a user before taken action by a staff, it also stays in the queue like above (The status is “Topic or post deleted” so it won’t affect pending state).

Also, I think this makes sense, if a user accidently deletes a pending topic, they can ask staff for recovery.

it would make sense to me for a confirm prompt instead of making a destructive action one click.

OK, I’ll add a pop-up so that users can confirm that.

Temporarily added a pop-up, and updated the demo video.

2 לייקים

In which similar cases does Discourse show a confirm prompt?
When I delete a post or topic I posted, there is no confirm step either. On my lists of bookmarks, “delete bookmark” also deletes it without asking again.
I understand asking again if information is permanently lost, like when you discard a draft, but I don’t think there should be too many of those, because then the important ones feel less important. (The discussion here might be interesting in this context too)
As long as a staff member could restore the topic, I don’t think this one needs a confirmation.

3 לייקים

Super nice @small-lovely-cat!

Makes sense to me

Wow, that’s weird. I had just tried to delete a topic and it didn’t warn me at all, even as a standard user. Now that I’ve done it that makes sense but maybe I’ve gotten so use to the admin UX that I forgot it doesn’t prompt you as a user because I thought it did honestly. However, it does happen on the reply pop-up which I feel like is roughly the same as this

At the end of the day I feel like it’s preference and I just prefer having a quick sanity check to prevent accidental clicks/taps.

לייק 1

But that is a case where the content of the post is lost otherwise, which is not the case in the other examples. I feel like in general Discourse was built with the idea that the user knows what they do and only warns if the consequences are severe.

לייק 1

This is exactly it, and not necessarily Discourse-specific but just general UX best practices: a modal/dialog is an element that causes friction in the user flow, and should only be used when an action is truly destructive. Anything that’s easily recovered or undone, can go ahead without it.

3 לייקים

I definitely agree with this, the problem is at least with this feature is that it can’t be undone without staff intervention it would seem. If I were a user and I fat-finger the “revoke post” button, I would rather have a modal stop me than need to go and ask the staff (who might not see it) to approve the post anyways.

לייק 1

Yes, the definition of “easy” is debatable

2 לייקים

The original method of deleting a pending post is going to the topic and scroll to the bottom, then click “Delete” button. This process is complex enough to prevent unintended actions.

As pending is a list, someone may accidentally clicked the deletion button of a wrong row, then had to contact a staff for recovery, and this may take some time and efforts. From the perspective of a user, I think maybe a confirm dialog is necessary here.

P.S. The original idea is just to keep the same logic as that of deleting a pending post from the topic.

לייק 1