Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

prevent panic with negative viewport height in stream tui

Dane Schneider57f0625a978d
diff --git a/app/cli/stream_tui/update.go b/app/cli/stream_tui/update.go
index f5a7c69d..94595d3b 100644
--- a/app/cli/stream_tui/update.go
+++ b/app/cli/stream_tui/update.go
@@ -263,6 +263,9 @@ func (m *streamUIModel) getViewportDimensions() (int, int) {
}
maxViewportHeight := h - (helpHeight + processingHeight + buildHeight)
+ if maxViewportHeight < 0 {
+ maxViewportHeight = 0
+ }
viewportHeight := min(maxViewportHeight, lipgloss.Height(m.mainDisplay))
viewportWidth := w
@@ -350,7 +353,6 @@ func (m *streamUIModel) scrollEnd() {
}
func (m *streamUIModel) streamUpdate(msg *shared.StreamMessage, deferUIUpdate bool) (tea.Model, tea.Cmd) {
-
switch msg.Type {
case shared.StreamMessageMulti: