When hiding...
... free text annotations: Only annotations that only contain free text annotations get hidden. All free text annotations that contain at least one structured annotation do not get hidden.
... annotations belonging to a category: All annotations that contain at least one label of the concerning category get hidden.
Suggested solution: Implement the same logic for hiding for both options of hiding annotations. Which one I don't care. There are reasons for both logics.
When hiding... ... free text annotations: Only annotations that only contain free text annotations get hidden. All free text annotations that contain at least one structured annotation do not get hidden. ... annotations belonging to a category: All annotations that contain at least one label of the concerning category get hidden.
Suggested solution: Implement the same logic for hiding for both options of hiding annotations. Which one I don't care. There are reasons for both logics.