From a0da44403ae944e7e19f001e5bf29d43dbb2830f Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sun, 15 Nov 2026 16:31:18 +0100 Subject: [PATCH] Don't shrink the side panels in portrait mode when the main view is split If the main view was split side by side, the side panels got only a sixth of the space so that the two panes had more room. In portrait mode the side panels are above the main view, so this made them lower rather than narrower, and the main view gained no width. With the default five side panels in a 20 row terminal, the files and branches panels were squashed into a single row. This could happen with mainPanelSplitMode set to horizontal, or with portraitMode set to always in a terminal of at most 30 rows. Co-Authored-By: Claude Opus 5.5 --- .../helpers/window_arrangement_helper.go | 2 +- .../helpers/window_arrangement_helper_test.go | 26 ------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/pkg/gui/controllers/helpers/window_arrangement_helper.go b/pkg/gui/controllers/helpers/window_arrangement_helper.go index e53dd68ec..72e267177 100644 --- a/pkg/gui/controllers/helpers/window_arrangement_helper.go +++ b/pkg/gui/controllers/helpers/window_arrangement_helper.go @@ -245,7 +245,7 @@ func getMidSectionWeights(args WindowArrangementArgs) (int, int) { mainSectionWeight := int(math.Round(maxColumnCount * (1 - sidePanelWidthRatio))) sideSectionWeight := int(math.Round(maxColumnCount * sidePanelWidthRatio)) - if splitMainPanelSideBySide(args) { + if splitMainPanelSideBySide(args) && !shouldUsePortraitMode(args) { mainSectionWeight = sideSectionWeight * 5 // need to shrink side panel to make way for main panels if side-by-side } diff --git a/pkg/gui/controllers/helpers/window_arrangement_helper_test.go b/pkg/gui/controllers/helpers/window_arrangement_helper_test.go index 7356d47e0..52f85b392 100644 --- a/pkg/gui/controllers/helpers/window_arrangement_helper_test.go +++ b/pkg/gui/controllers/helpers/window_arrangement_helper_test.go @@ -545,7 +545,6 @@ func TestGetWindowDimensions(t *testing.T) { args.UserConfig.Gui.MainPanelSplitMode = "horizontal" args.MainPanes = types.BothMainPanes }, - /* EXPECTED: expected: ` ╭files───────────────────────────────────────────╮ @@ -570,31 +569,6 @@ func TestGetWindowDimensions(t *testing.T) { A: statusSpacer1 B: information `, - ACTUAL: */ - expected: ` - - - - - ╭main───────────────────╮╭secondary──────────────╮ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - │ ││ │ - ╰───────────────────────╯╰───────────────────────╯ - A - A: statusSpacer1 - B: information - `, }, { name: "portrait auto mode, disabled because width is too large",