fix(sftp): stop calling a filtered-out directory empty

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.
This commit is contained in:
l0ng-ai
2026-08-08 20:59:43 +07:00
parent ca8af9d169
commit 3e7ff034e1
+5
View File
@@ -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()
};