summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--packages/tui/internal/components/dialog/help.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/tui/internal/components/dialog/help.go b/packages/tui/internal/components/dialog/help.go
index 4107384f8..51adc3a1c 100644
--- a/packages/tui/internal/components/dialog/help.go
+++ b/packages/tui/internal/components/dialog/help.go
@@ -30,9 +30,10 @@ func (h *helpDialog) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
case tea.WindowSizeMsg:
h.width = msg.Width
h.height = msg.Height
- // Set viewport size with some padding for the modal
- h.viewport = viewport.New(viewport.WithWidth(msg.Width-4), viewport.WithHeight(msg.Height-6))
- h.commandsComponent.SetSize(msg.Width-4, msg.Height-6)
+ // Set viewport size with some padding for the modal, but cap at reasonable width
+ maxWidth := min(80, msg.Width-8)
+ h.viewport = viewport.New(viewport.WithWidth(maxWidth-4), viewport.WithHeight(msg.Height-6))
+ h.commandsComponent.SetSize(maxWidth-4, msg.Height-6)
}
// Update viewport content
@@ -73,7 +74,7 @@ func NewHelpDialog(app *app.App) HelpDialog {
commandsComponent.WithShowAll(true),
commandsComponent.WithKeybinds(true),
),
- modal: modal.New(modal.WithTitle("Help")),
+ modal: modal.New(modal.WithTitle("Help"), modal.WithMaxWidth(80)),
viewport: vp,
}
}