Not sure if this is possible or how complex it would be to implement. If this feature already exists, my apologies but I did not find the appropriate settings in Admin.
Rather than displaying categories in menus, the site map, etc., based upon a manual setting in Admin, it would be great to be able to show/hide categories and subcategories dynamically based upon whether there are in-stock products assigned to them.
This would make managing storefront display much easier, as when a category gets sold out, it simply disappears from the store front until such time an active in-stock product is assigned or re-assigned to that category.
Thank you.