When I insert a file as a block instance, it seems that all the materials from the inserted file are automatically uploaded to the Material Panel. This feature works fine until I attempt to undo the insertion. While the inserted file does disappear as expected upon undoing, the materials, unfortunately, remain in the Material Panel. This results in a cluttered and confusing workspace as the Material Panel gets populated with numerous unused materials, making it increasingly difficult to manage.
In other words, this could be improved by ensuring that when an insertion is undone, any materials that were added as a result of that insertion are also removed from the Material Panel.