diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-09 00:32:05 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-09 00:32:05 +0300 |
| commit | 8be4cf765afddfd9cf3206602ba4dab682a29fa1 (patch) | |
| tree | 05bbf779fcaef09f32df3e7a50a053e9a656f58c /src/client/shell/worktrees.rs | |
| parent | 8996fc54fe4596368a1677821b1a390a70c56ab0 (diff) | |
fix: restore autofocus when creating worktrees (#3787)
* fix: restore autofocus when creating worktrees
refs #3766
* fix: let the client focus newly created worktrees
refs #3766
Diffstat (limited to 'src/client/shell/worktrees.rs')
| -rw-r--r-- | src/client/shell/worktrees.rs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/client/shell/worktrees.rs b/src/client/shell/worktrees.rs index 8218c0cc..bf923557 100644 --- a/src/client/shell/worktrees.rs +++ b/src/client/shell/worktrees.rs @@ -291,7 +291,7 @@ impl ClientShellState { base: Some("HEAD".to_owned()), path: None, label: None, - focus: true, + focus: false, trust_repository: false, }), PendingEndpointKind::WorktreeCreate, @@ -390,6 +390,7 @@ impl ClientShellState { &mut self, kind: PendingEndpointKind, result: Result<crate::api::schema::ResponseResult, ClientShellEndpointError>, + outcome: &mut ClientShellInput, ) -> bool { use crate::api::schema::ResponseResult; @@ -481,8 +482,20 @@ impl ClientShellState { } true } - (PendingEndpointKind::WorktreeCreate, Ok(ResponseResult::WorktreeCreated { .. })) - | (PendingEndpointKind::WorktreeOpen, Ok(ResponseResult::WorktreeOpened { .. })) + ( + PendingEndpointKind::WorktreeCreate, + Ok(ResponseResult::WorktreeCreated { tab, .. }), + ) => { + self.overlay = None; + self.push_endpoint_method( + crate::api::schema::Method::TabFocus(crate::api::schema::TabTarget { + tab_id: tab.tab_id, + }), + outcome, + ); + true + } + (PendingEndpointKind::WorktreeOpen, Ok(ResponseResult::WorktreeOpened { .. })) | ( PendingEndpointKind::WorktreeRemove { .. }, Ok(ResponseResult::WorktreeRemoved { .. }), |
