From 49c267d0da2416a2b48192e4d51fddcf0c5c8d37 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 7 Sep 2026 19:02:48 +0200 Subject: [PATCH] Give the maximum width of a menu a name The recent repos menu is about to size its columns to fit into a menu of that width. Co-authored-by: Claude Opus 5 (1M context) --- pkg/gui/controllers/helpers/confirmation_helper.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/gui/controllers/helpers/confirmation_helper.go b/pkg/gui/controllers/helpers/confirmation_helper.go index ca25204a6..6bfd7ca4e 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper.go +++ b/pkg/gui/controllers/helpers/confirmation_helper.go @@ -333,6 +333,10 @@ func (self *ConfirmationHelper) ResizeCurrentPopupPanels() { } } +// The width a menu grows to when the window is wide enough for it. Its content +// is two columns narrower than this, for the frame. +const menuMaxWidth = 90 + // The rows that a filter row adds to a menu popup: one for the input, and one // for its bottom border. Its top border is the menu's bottom border. const menuFilterRowHeight = 2 @@ -368,7 +372,7 @@ func (self *ConfirmationHelper) resizeMenu(parentPopupContext types.Context) { // resize the window itemCount := menuContext.UnfilteredLen() offset := 3 - panelWidth := self.getPopupPanelWidth(90) + panelWidth := self.getPopupPanelWidth(menuMaxWidth) contentWidth := panelWidth - 2 // minus 2 for the frame promptLinesCount := self.layoutMenuPrompt(contentWidth) // The row is reserved for the whole time the menu is open, even though it only