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.
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.
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.