mirror of
https://github.com/l0ng-ai/tty7.git
synced 2026-09-22 16:02:24 +00:00
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:
@@ -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()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user