fix: remove panics and unblock flows
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-11-25 03:20:40 +07:00
parent 0fd8ea12fb
commit 3f64b36ff4
52 changed files with 753 additions and 567 deletions
+4 -9
View File
@@ -37,7 +37,8 @@ pub struct RepoHistoryView {
/// The last load failure, shown instead of the empty list.
error: Option<SharedString>,
scroll_handle: UniformListScrollHandle,
tasks: Vec<Task<Result<(), Error>>>,
/// The latest walk, assigning it cancels the previous one.
load_task: Option<Task<Result<(), Error>>>,
}
impl RepoHistoryView {
@@ -58,7 +59,7 @@ impl RepoHistoryView {
commits: Arc::new(Vec::new()),
error: None,
scroll_handle: UniformListScrollHandle::new(),
tasks: Vec::new(),
load_task: None,
}
}
@@ -82,12 +83,6 @@ impl RepoHistoryView {
self.load(cx);
}
/// 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 load(&mut self, cx: &mut Context<Self>) {
if self.loading_all_commits || self.all_commits.is_some() {
return;
@@ -122,7 +117,7 @@ impl RepoHistoryView {
Ok(())
});
self.push_task(task);
self.load_task = Some(task);
}
pub fn open_commit_diff(