Filters a tree structure of layers based on a search query. Updates the visibility of layers matching the search text.