From d9487bf31c74f8287ff9d6fd10da777cd840ded2 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 23 Mar 2026 17:22:22 +0100 Subject: [PATCH] Fix the expanded layout of the branches panel (half and full screen modes) If the showDivergenceFromBaseBranch config is not none, the expanded branches panel would no longer show the remote branch and subject; the reason was that we padded the name all the way to the right edge of the view so that the divergence information is right-aligned. To fix this, we simply don't right-align the divergence in half or full screen mode. This is a bit unfortunate, but it's hard to do any better, because we don't know the width of our column in advance. One thing I tried is to make the divergence a separate column in that case (with an explicit right-alignment set on it via getColumnAlignments; however, this makes it harder to properly truncate the name when the window is too narrow. --- pkg/gui/presentation/branches.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/gui/presentation/branches.go b/pkg/gui/presentation/branches.go index 7a32265a2..1120ed99a 100644 --- a/pkg/gui/presentation/branches.go +++ b/pkg/gui/presentation/branches.go @@ -145,7 +145,13 @@ func getBranchDisplayStrings( } if divergence != "" { - paddingNeededForDivergence -= utils.StringWidth(utils.Decolorise(coloredName)) - 1 + if fullDescription { + // don't right-align the divergence in half or full screen mode, since other fields + // follow in that case and we don't know the width of our column + paddingNeededForDivergence = 1 + } else { + paddingNeededForDivergence -= utils.StringWidth(utils.Decolorise(coloredName)) - 1 + } if paddingNeededForDivergence > 0 { coloredName += strings.Repeat(" ", paddingNeededForDivergence) coloredName += style.FgCyan.Sprint(divergence)