From 3e7ff034e161e5e2b5ce2c83f751f2f133a15dee Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:59:43 +0700 Subject: [PATCH] fix(sftp): stop calling a filtered-out directory empty MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Typing a filter that matched no entry left the remote Files panel saying "Empty directory." — not silence, a false statement, and about a machine the reader cannot see for themselves. It now says which query matched nothing, the way the local file tree already does for the same case. Not verified on screen: reaching this panel needs a live SSH host. The branch is the one the local tree takes, and the full suite passes. --- src/ui/sftp.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ui/sftp.rs b/src/ui/sftp.rs index 9471d7f5..479a8adb 100644 --- a/src/ui/sftp.rs +++ b/src/ui/sftp.rs @@ -1245,8 +1245,13 @@ impl Tty7App { let show_go_up = self.sftp_panel.cwd != "/" && filter.trim().is_empty(); if entries.is_empty() && !show_go_up { + // A filter that matched nothing is not an empty directory, and + // saying so about a machine you cannot see is worse than saying + // nothing. The local file tree already draws this distinction. let text: gpui::SharedString = if self.sftp_panel.loading { t(L10nKey::SftpLoading).into() + } else if !filter.trim().is_empty() { + t_fmt(L10nKey::SettingsNothingMatches, &[("query", filter.trim())]).into() } else { t(L10nKey::SftpEmptyDirectory).into() };