Ensure only visible top-level items are considered Prevent hidden items from appearing in the menu hierarchy