chore: improve ui consistently (#35)
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run

Reviewed-on: #35
This commit was merged in pull request #35.
This commit is contained in:
2026-11-20 12:28:25 +00:00
parent 51dd5c8630
commit f850f4c4c1
90 changed files with 2859 additions and 2061 deletions
+15 -2
View File
@@ -493,6 +493,12 @@ impl RepoFilesView {
.into_any_element()
}
/// Reaps finished tasks, then queues another.
fn push_task(&mut self, task: Task<Result<(), Error>>) {
self.tasks.retain(|task| !task.is_ready());
self.tasks.push(task);
}
fn open_file(&mut self, path: &str, window: &mut Window, cx: &mut Context<Self>) {
self.selected_file = Some(path.into());
@@ -528,7 +534,14 @@ impl RepoFilesView {
return;
};
// Tree paths originate from git, so symlink escapes are accepted; only
// crafted components are rejected, and visibly.
if unsafe_path {
self.files.insert(
path.to_string(),
FileContent::Failed("Cannot open file".into()),
);
cx.notify();
return;
}
@@ -600,7 +613,7 @@ impl RepoFilesView {
Ok(())
});
self.tasks.push(task);
self.push_task(task);
}
fn drop_preview_of(&mut self, path: &str) {
@@ -705,6 +718,6 @@ impl RepoFilesView {
Ok(())
});
self.tasks.push(task);
self.push_task(task);
}
}