From 9917b226e39863c3c053ea96ee64453cdfa9092c Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 11 Feb 2026 13:32:50 +0300 Subject: [PATCH] fix(ui): adjust sessions dialog size Use a more reasonable size for the sessions dialog. --- internal/ui/dialog/commands.go | 8 +++----- internal/ui/dialog/dialog.go | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/ui/dialog/commands.go b/internal/ui/dialog/commands.go index 0b0185b03a3c992ce55ff9164ceba6115260c174..a560ce21c0a8985ddd245dffbb6045ec08350212 100644 --- a/internal/ui/dialog/commands.go +++ b/internal/ui/dialog/commands.go @@ -27,9 +27,7 @@ type CommandType uint func (c CommandType) String() string { return []string{"System", "User", "MCP"}[c] } const ( - sidebarCompactModeBreakpoint = 120 - defaultCommandsDialogMaxHeight = 20 - defaultCommandsDialogMaxWidth = 70 + sidebarCompactModeBreakpoint = 120 ) const ( @@ -240,8 +238,8 @@ func commandsRadioView(sty *styles.Styles, selected CommandType, hasUserCmds boo // Draw implements [Dialog]. func (c *Commands) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor { t := c.com.Styles - width := max(0, min(defaultCommandsDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize())) - height := max(0, min(defaultCommandsDialogMaxHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize())) + width := max(0, min(defaultDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize())) + height := max(0, min(defaultDialogHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize())) if area.Dx() != c.windowWidth && c.selected == SystemCommands { c.windowWidth = area.Dx() // since some items in the list depend on width (e.g. toggle sidebar command), diff --git a/internal/ui/dialog/dialog.go b/internal/ui/dialog/dialog.go index 990b4ed68174bee20d627dec5f7176d9466b77d8..15e0fa52f5ab7b181e5659e7526213d254f01931 100644 --- a/internal/ui/dialog/dialog.go +++ b/internal/ui/dialog/dialog.go @@ -11,9 +11,9 @@ import ( // Dialog sizing constants. const ( // defaultDialogMaxWidth is the maximum width for standard dialogs. - defaultDialogMaxWidth = 120 + defaultDialogMaxWidth = 70 // defaultDialogHeight is the default height for standard dialogs. - defaultDialogHeight = 30 + defaultDialogHeight = 20 // titleContentHeight is the height of the title content line. titleContentHeight = 1 // inputContentHeight is the height of the input content line.