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) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller 2026-09-07 19:02:48 +02:00
parent 2135e928db
commit e7d0ccc0c1

View file

@ -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