From cee2de60ba59f88cfb6f3d661b5ee97dba04a851 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 22 May 2026 18:19:23 +0200 Subject: [PATCH] Signal ambiguity in the move-commits-to-new-branch label and prompt Same idea as the rebase and view-divergence labels: when the base is ambiguous, the menu prompt and the "New branch from base branch (...)" item both substitute "pick: main, develop" for the parenthetical so the user knows the disambiguation picker will appear before they pick the "from base" option. --- pkg/gui/controllers/helpers/refs_helper.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkg/gui/controllers/helpers/refs_helper.go b/pkg/gui/controllers/helpers/refs_helper.go index ce8d96df9..8d0d59370 100644 --- a/pkg/gui/controllers/helpers/refs_helper.go +++ b/pkg/gui/controllers/helpers/refs_helper.go @@ -480,11 +480,19 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error { return nil } - shortBaseBranchName := ShortBranchName(baseBranchRef) + baseBranchLabel := ShortBranchName(baseBranchRef) + if baseAmbiguous { + shortNames := lo.Map(baseCandidates, func(ref string, _ int) string { + return ShortBranchName(ref) + }) + baseBranchLabel = utils.ResolvePlaceholderString(self.c.Tr.PickBaseBranchLabel, + map[string]string{"candidates": strings.Join(shortNames, ", ")}, + ) + } prompt := utils.ResolvePlaceholderString( self.c.Tr.MoveCommitsToNewBranchMenuPrompt, map[string]string{ - "baseBranchName": shortBaseBranchName, + "baseBranchName": baseBranchLabel, }, ) return self.c.Menu(types.CreateMenuOptions{ @@ -492,7 +500,7 @@ func (self *RefsHelper) MoveCommitsToNewBranch() error { Prompt: prompt, Items: []*types.MenuItem{ { - Label: fmt.Sprintf(self.c.Tr.MoveCommitsToNewBranchFromBaseItem, shortBaseBranchName), + Label: fmt.Sprintf(self.c.Tr.MoveCommitsToNewBranchFromBaseItem, baseBranchLabel), OnPress: func() error { moveOff := func(base string) error { return withNewBranchNamePrompt(ShortBranchName(base), func(newBranchName string) error {