From a1a599dac5fc0d10c03d30067ea11c5539abb262 Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Fri, 14 Nov 2025 14:45:58 -0300 Subject: [PATCH] collab_ui: Fix search matching in the panel (#42743) Release Notes: - collab: Fixed a regression where search matches wouldn't expand the parent channel if that happened to be collapsed. --- crates/collab_ui/src/collab_panel.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index 97559f41a76bed36f22d3ef22bc95d913a462116..b57d0279545aed8f896179968c877efb72e7c772 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -672,20 +672,25 @@ impl CollabPanel { { self.entries.push(ListEntry::ChannelEditor { depth: 0 }); } + + let should_respect_collapse = query.is_empty(); let mut collapse_depth = None; + for (idx, channel) in channels.into_iter().enumerate() { let depth = channel.parent_path.len(); - if collapse_depth.is_none() && self.is_channel_collapsed(channel.id) { - collapse_depth = Some(depth); - } else if let Some(collapsed_depth) = collapse_depth { - if depth > collapsed_depth { - continue; - } - if self.is_channel_collapsed(channel.id) { + if should_respect_collapse { + if collapse_depth.is_none() && self.is_channel_collapsed(channel.id) { collapse_depth = Some(depth); - } else { - collapse_depth = None; + } else if let Some(collapsed_depth) = collapse_depth { + if depth > collapsed_depth { + continue; + } + if self.is_channel_collapsed(channel.id) { + collapse_depth = Some(depth); + } else { + collapse_depth = None; + } } }