diff --git a/internal/ui/dialog/commands.go b/internal/ui/dialog/commands.go index 416f5a0131e2dc7cf36561f118daed248ceebd08..0b0185b03a3c992ce55ff9164ceba6115260c174 100644 --- a/internal/ui/dialog/commands.go +++ b/internal/ui/dialog/commands.go @@ -240,8 +240,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())) - height := max(0, min(defaultCommandsDialogMaxHeight, area.Dy())) + width := max(0, min(defaultCommandsDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize())) + height := max(0, min(defaultCommandsDialogMaxHeight, 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/models.go b/internal/ui/dialog/models.go index 354d02434a6623b5a9833bc010f4eaa8d1efdc7a..44ff42a23c5eb722e4baa764346f631292799b30 100644 --- a/internal/ui/dialog/models.go +++ b/internal/ui/dialog/models.go @@ -251,8 +251,8 @@ func (m *Models) modelTypeRadioView() string { // Draw implements [Dialog]. func (m *Models) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor { t := m.com.Styles - width := max(0, min(defaultModelsDialogMaxWidth, area.Dx())) - height := max(0, min(defaultDialogHeight, area.Dy())) + width := max(0, min(defaultModelsDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize())) + height := max(0, min(defaultDialogHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize())) innerWidth := width - t.Dialog.View.GetHorizontalFrameSize() heightOffset := t.Dialog.Title.GetVerticalFrameSize() + titleContentHeight + t.Dialog.InputPrompt.GetVerticalFrameSize() + inputContentHeight +