Improve UX for deleting category with topics inside

Context

Discussion on other topics

Feature

Instead of disabling the Delete Category button when there are topics inside that category,

Discourse could instead first show a modal that includes options for handling the topics, before confirming that you would like to delete the category.

Mockups

Without option to add tags:

With option to add tags:

Details

This would save the user from having to exit the category settings page, bulk-selecting the topics in the category and moving them elsewhere.

When you try to delete a category with topics in it, it could first suggest if you would like to:

  • move all the existing topics to another category, or
  • move all the existing topics into Uncategorized, or
    • (if Uncategorized is not enabled, offer to enable Uncategorized)
  • delete all topics in the category

and then confirming that you would like to delete the category.

With the options of moving the topics, it could also offer the option of adding tags to the topics.

3 Likes

That’d need to check if the setting to allow Uncategorized is enabled first.

1 Like

Just to cross-link a similar recent comment on this as well:

2 Likes

It could enable that, too.

1 Like

I forgot about the option of adding tags to the topics too, for deleting a category. So I’ve added that here.

Here are initial mockups:

Without option to add tags

With option to add tags

I’ve added these to the OP. Happy to make changes if anyone has suggestions.

Thanks – added it to the OP
Meant to handle that case of Uncategorized being enabled or not, but forgot.

I’m not sure if I agree with offering the option to change a site setting in this context. In a community with a number of administrators, one doing housekeeping might choose this option without knowing why it was disabled or understanding the implications of enabling it.

I haven’t looked to see if there is a precedent for offering site settings changes in this way but it seems dangerous to allow settings to be changed as an aside to performing other tasks.

Potentially category deletion is disabled here for a similar reason, i.e. to encourage examining which topics are going to be deleted, though I don’t have a strong opinion about that. If that is true, perhaps the help text for the disabled delete button could be improved with a brief explanation of that.

1 Like

image

The preference itself is suffering from the very same problem as the posts: It requires you to run about the place cleaning up stuff yourself when it could have a flow to do it automatically.

It is a weird preference to begin with. It’s one thing to require posters to select a category before posting - it’s another if an admin action leaves posts uncategorized.

I see two potential fixes for this:

  • Restrict the preference to be about just the “Allow topics to be created without a category” bit. This means that this preference would have no effect on moving posts, recategorizing posts by an admin, or stuff falling into it when a category is being deleted.
  • Delete the preference altogether and expose an “uncategorized” category in the category overview which can receive per-category permissions just like a normal category could.

One other thing to consider for Uncategorized is that it’s also been semi-replaced by the new default-seeded General category. Newer sites may have no need for it any longer, though supporting its existence on older ones is likely still a thing.