From d688fa9319a160ecb6ae8cb037fd062114c2e61d Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Fri, 22 May 2026 18:18:02 +0200 Subject: [PATCH] Signal ambiguity in the view-divergence-from-base-branch label Same idea as the rebase menu's label: when the resolver reports the selected branch's base is ambiguous, show "pick: main, develop" in the parenthetical instead of just the config-order tiebreak, so the user knows the prompt will appear before they press 'b'. --- pkg/gui/controllers/branches_controller.go | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pkg/gui/controllers/branches_controller.go b/pkg/gui/controllers/branches_controller.go index c4f94b4cd..193e7acb0 100644 --- a/pkg/gui/controllers/branches_controller.go +++ b/pkg/gui/controllers/branches_controller.go @@ -295,15 +295,22 @@ func (self *BranchesController) viewUpstreamOptions(selectedBranch *models.Branc if err != nil { return err } - baseBranchLabel := baseBranch - if baseBranchLabel == "" { + baseBranchLabel := helpers.ShortBranchName(baseBranch) + switch { + case baseBranch == "": baseBranchLabel = self.c.Tr.CouldNotDetermineBaseBranch disabledReason = &types.DisabledReason{Text: self.c.Tr.CouldNotDetermineBaseBranch} + case baseAmbiguous: + shortNames := lo.Map(baseCandidates, func(ref string, _ int) string { + return helpers.ShortBranchName(ref) + }) + baseBranchLabel = utils.ResolvePlaceholderString(self.c.Tr.PickBaseBranchLabel, + map[string]string{"candidates": strings.Join(shortNames, ", ")}, + ) } - shortBaseBranchName := helpers.ShortBranchName(baseBranchLabel) label := utils.ResolvePlaceholderString( self.c.Tr.ViewDivergenceFromBaseBranch, - map[string]string{"baseBranch": shortBaseBranchName}, + map[string]string{"baseBranch": baseBranchLabel}, ) viewDivergenceFromBaseBranchItem := &types.MenuItem{ LabelColumns: []string{label},