on main help sign in
fix(ui): ensure the min size accounts for the dialog border
361a318Ayman Bagabas
internal/ui/dialog/sessions.go+3−3
@@ -229,9 +229,9 @@ func (s *Session) Cursor() *tea.Cursor {
229// Draw implements [Dialog].
229// Draw implements [Dialog].
230func (s *Session) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
230func (s *Session) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
231 t := s.com.Styles
231 t := s.com.Styles
232− width := max(0, min(defaultDialogMaxWidth, area.Dx()))
232+ width := max(0, min(defaultDialogMaxWidth, area.Dx()-t.Dialog.View.GetHorizontalBorderSize()))
233− height := max(0, min(defaultDialogHeight, area.Dy()))
233+ height := max(0, min(defaultDialogHeight, area.Dy()-t.Dialog.View.GetVerticalBorderSize()))
234− innerWidth := width - t.Dialog.View.GetHorizontalFrameSize() - 2
234+ innerWidth := width - t.Dialog.View.GetHorizontalFrameSize()
235 heightOffset := t.Dialog.Title.GetVerticalFrameSize() + titleContentHeight +
235 heightOffset := t.Dialog.Title.GetVerticalFrameSize() + titleContentHeight +
236 t.Dialog.InputPrompt.GetVerticalFrameSize() + inputContentHeight +
236 t.Dialog.InputPrompt.GetVerticalFrameSize() + inputContentHeight +
237 t.Dialog.HelpView.GetVerticalFrameSize() +
237 t.Dialog.HelpView.GetVerticalFrameSize() +