def _update_view_index_in_category(self, view: BaseView) -> None:
        """
        Set lowest available index value in category for a view not yet added.
        """
        existing_views = self.views_by_category[view.category]
        if view in existing_views:
            return
        existing_ids = {view.index for view in existing_views}
        max_id = max(existing_ids) if existing_ids else 0
        candidates = set(range(1, max_id + 2)) - existing_ids
        view.index = min(candidates)

        Set lowest available index value in category for a view not yet added.
        
angrmanagement/ui/view_manager.py