From 7f3f69dfd635910ad4304738ecd33258cc3fa4f1 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 8 Aug 2026 04:27:23 +0800 Subject: [PATCH] fix(sidebar): search what the row shows, not just the part that fits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Each sidebar row shows a truncated title and a branch. The filter read only the truncated title, so typing the branch you can see — or the part of the path the row elided — matched nothing, and the list emptied out on a query that is plainly on screen. It now matches the full title and the branch as well as the label. --- src/ui/tab_sidebar.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index 0a7bbe7f..66edf30c 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -79,7 +79,21 @@ impl Tty7App { s.tabs .iter() .map(|&i| (i, self.tab_label(&self.tabs[i], i, Some(window), cx))) - .filter(|(_, label)| query.is_empty() || label.to_lowercase().contains(&query)) + // The row shows a truncated title and a branch; the filter + // only ever read the truncated title, so typing the branch + // you can see, or the part of the path the row elided, + // matched nothing. + .filter(|(i, label)| { + query.is_empty() + || label.to_lowercase().contains(&query) + || self.tabs[*i] + .leaf_title(Some(window), cx) + .to_lowercase() + .contains(&query) + || self.tabs[*i] + .git_status(Some(window), cx) + .is_some_and(|g| g.branch.to_lowercase().contains(&query)) + }) .collect() }) .collect();