From dd33ddf28d693b2c64ed91f75656c61416ee2538 Mon Sep 17 00:00:00 2001 From: JJ Liebig Date: Tue, 22 Sep 2026 18:43:12 +0200 Subject: fix: move worktree lookups async (#4492) --- src/events.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/events.rs') diff --git a/src/events.rs b/src/events.rs index 95638991..a614ee0c 100644 --- a/src/events.rs +++ b/src/events.rs @@ -52,6 +52,27 @@ pub struct WorktreeRemoveResult { pub result: Result<(), String>, } +#[derive(Debug)] +pub struct WorktreeReadResult { + // Keep the slot until completion is consumed, including time queued on the app loop. + pub(crate) _permit: tokio::sync::OwnedSemaphorePermit, + pub(crate) client_local: bool, + pub(crate) request: crate::api::schema::Request, + pub(crate) source_workspace_id: Option, + pub(crate) source_cwd: Option, + pub(crate) result: Result, + pub(crate) respond_to: std::sync::mpsc::Sender, +} + +#[derive(Debug)] +pub(crate) struct WorktreeReadData { + pub source_checkout_path: std::path::PathBuf, + pub source_repo_root: std::path::PathBuf, + pub repo_key: String, + pub repo_name: String, + pub entries: Vec, +} + /// An event from a background task to the main loop. #[derive(Debug)] pub enum AppEvent { @@ -173,4 +194,6 @@ pub enum AppEvent { WorktreeAddFinished(Box), /// Background `git worktree remove` completed. WorktreeRemoveFinished(Box), + /// Background worktree discovery completed for an API list/open request. + WorktreeReadFinished(Box), } -- cgit v1.2.3