fix(files): say which file would not delete

The file tree's delete failure read "Delete failed" with the OS reason
appended — "Delete failed: Permission denied" — and never the name. In a
tree of files that is the first thing you need, which is exactly the reason
the editor's save failure stopped saying "Save failed" and started naming
its file.

The name is already in hand for the confirmation the delete opens with.
This commit is contained in:
l0ng-ai
2026-08-08 19:20:25 +07:00
parent 37659990ff
commit ef1061acfb
4 changed files with 11 additions and 4 deletions
+8 -1
View File
@@ -1178,6 +1178,10 @@ impl Tty7App {
code.selected = None;
}
let target = path.clone();
// "Delete failed: Permission denied" leaves out the one thing
// you need in a tree of files, the same way "Save failed" used
// to in the editor.
let failed_name = name.clone();
HostOps::run_in(
host,
window,
@@ -1193,7 +1197,10 @@ impl Tty7App {
HostOps::notify_err(
window,
cx,
t(L10nKey::FileTreeDeleteFailed),
&t_fmt(
L10nKey::FileTreeDeleteFailed,
&[("name", &failed_name)],
),
&e,
);
}
+1 -1
View File
@@ -806,7 +806,7 @@ pub fn translate_en(key: L10nKey) -> &'static str {
L10nKey::SftpDeleteFileBody => {
"The file will be deleted on {host}. There is no trash on the far side."
}
L10nKey::FileTreeDeleteFailed => "Delete failed",
L10nKey::FileTreeDeleteFailed => "Could not delete {name}",
L10nKey::FileTreeContextOpen => "Open",
L10nKey::FileTreeContextCdHere => "cd Here",
L10nKey::FileTreeContextInsertPath => "Insert Path in Terminal",
+1 -1
View File
@@ -847,7 +847,7 @@ pub fn translate_ja(key: L10nKey) -> Option<&'static str> {
L10nKey::SftpDeleteFileBody => {
"{host} 上でファイルが削除されます。リモート側にゴミ箱はありません。"
}
L10nKey::FileTreeDeleteFailed => "削除に失敗しました",
L10nKey::FileTreeDeleteFailed => "{name} を削除できませんでした",
L10nKey::FileTreeContextOpen => "開く",
L10nKey::FileTreeContextCdHere => "ここで cd",
L10nKey::FileTreeContextInsertPath => "ターミナルにパスを挿入",
+1 -1
View File
@@ -772,7 +772,7 @@ pub fn translate_zh(key: L10nKey) -> Option<&'static str> {
"该文件夹及其中所有内容将在 {host} 上被删除。远端没有回收站。"
}
L10nKey::SftpDeleteFileBody => "该文件将在 {host} 上被删除。远端没有回收站。",
L10nKey::FileTreeDeleteFailed => "删除失败",
L10nKey::FileTreeDeleteFailed => "无法删除 {name}",
L10nKey::FileTreeContextOpen => "打开",
L10nKey::FileTreeContextCdHere => "cd 到此处",
L10nKey::FileTreeContextInsertPath => "在终端中插入路径",