From 43ae618b62ddbc36664b1b08ef31ac27e7108b96 Mon Sep 17 00:00:00 2001 From: Mitchell Cash Date: Sun, 24 May 2026 09:14:32 +0100 Subject: [PATCH] Add hotkeys to the worktree-conflict menu shown when deleting a branch --- pkg/gui/controllers/helpers/branches_helper.go | 3 +++ pkg/integration/tests/worktree/detach_worktree_from_branch.go | 2 +- pkg/integration/tests/worktree/remove_worktree_from_branch.go | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/gui/controllers/helpers/branches_helper.go b/pkg/gui/controllers/helpers/branches_helper.go index 8af447f79b2..bc0eea48e21 100644 --- a/pkg/gui/controllers/helpers/branches_helper.go +++ b/pkg/gui/controllers/helpers/branches_helper.go @@ -223,6 +223,7 @@ func (self *BranchesHelper) promptWorktreeBranchDelete(selectedBranch *models.Br Items: []*types.MenuItem{ { Label: self.c.Tr.SwitchToWorktree, + Key: gocui.NewKeyRune('s'), OnPress: func() error { return self.worktreeHelper.Switch(worktree, context.LOCAL_BRANCHES_CONTEXT_KEY) }, @@ -230,12 +231,14 @@ func (self *BranchesHelper) promptWorktreeBranchDelete(selectedBranch *models.Br { Label: self.c.Tr.DetachWorktree, Tooltip: self.c.Tr.DetachWorktreeTooltip, + Key: gocui.NewKeyRune('d'), OnPress: func() error { return self.worktreeHelper.Detach(worktree) }, }, { Label: self.c.Tr.RemoveWorktree, + Key: gocui.NewKeyRune('r'), OnPress: func() error { return self.worktreeHelper.Remove(worktree, false) }, diff --git a/pkg/integration/tests/worktree/detach_worktree_from_branch.go b/pkg/integration/tests/worktree/detach_worktree_from_branch.go index acd40e6ad45..19c7fce7926 100644 --- a/pkg/integration/tests/worktree/detach_worktree_from_branch.go +++ b/pkg/integration/tests/worktree/detach_worktree_from_branch.go @@ -37,7 +37,7 @@ var DetachWorktreeFromBranch = NewIntegrationTest(NewIntegrationTestArgs{ Tap(func() { t.ExpectPopup().Menu(). Title(Equals("Branch newbranch is checked out by worktree linked-worktree")). - Select(Equals("Detach worktree")). + Select(Contains("Detach worktree")). Confirm() }). Lines( diff --git a/pkg/integration/tests/worktree/remove_worktree_from_branch.go b/pkg/integration/tests/worktree/remove_worktree_from_branch.go index 1aa9645f3f0..3893aef2b86 100644 --- a/pkg/integration/tests/worktree/remove_worktree_from_branch.go +++ b/pkg/integration/tests/worktree/remove_worktree_from_branch.go @@ -38,7 +38,7 @@ var RemoveWorktreeFromBranch = NewIntegrationTest(NewIntegrationTestArgs{ Tap(func() { t.ExpectPopup().Menu(). Title(Equals("Branch newbranch is checked out by worktree linked-worktree")). - Select(Equals("Remove worktree")). + Select(Contains("Remove worktree")). Confirm() t.ExpectPopup().Confirmation().