fix(ui): fix permissions dialog rendering on small windows (#2093)

Andrey Nering created

* Ensure the viewport content is at least 3 cells tall, to always be able
  to render at least 1 line of content + 1 top and 1 bottom margin.
* Render in fullscreen as soon as we don't have enough space to render
  buttons without wrapping.

Change summary

internal/ui/dialog/permissions.go | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Detailed changes

internal/ui/dialog/permissions.go 🔗

@@ -48,7 +48,7 @@ const (
 	// layoutSpacingLines is the number of empty lines used for layout spacing.
 	layoutSpacingLines = 4
 	// minWindowWidth is the minimum window width before forcing fullscreen.
-	minWindowWidth = 60
+	minWindowWidth = 77
 	// minWindowHeight is the minimum window height before forcing fullscreen.
 	minWindowHeight = 20
 )
@@ -392,6 +392,7 @@ func (p *Permissions) Draw(scr uv.Screen, area uv.Rectangle) *tea.Cursor {
 		} else {
 			availableHeight = maxHeight - fixedHeight
 		}
+		availableHeight = max(availableHeight, 3)
 	} else {
 		availableHeight = maxHeight - headerHeight - buttonsHeight - helpHeight - frameHeight
 	}