From e7d0ccc0c1f10a290291c74e6c6b7bfd9ffdceb4 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 f525c1d8a..48af5aa41 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper.go +++ b/pkg/gui/controllers/helpers/confirmation_helper.go @@ -324,6 +324,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 @@ -359,7 +363,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