diff --git a/internal/tui/model.go b/internal/tui/model.go index 878d9df..4de52e5 100644 --- a/internal/tui/model.go +++ b/internal/tui/model.go @@ -263,17 +263,21 @@ func (m Model) View() string { leftWidth := m.width - rightWidth - 3 chatHeight := m.height - 5 - m.textarea.SetWidth(leftWidth) - m.viewport.Width = leftWidth - m.viewport.Height = chatHeight - chatBox := boxStyle.Width(leftWidth).Height(chatHeight).Render(m.viewport.View()) inputBox := boxStyle.Width(leftWidth).Render(m.textarea.View()) leftPanel := lipgloss.JoinVertical(lipgloss.Left, chatBox, inputBox) stats := m.renderStats() agents := m.renderAgents() - empty := boxStyle.Width(rightWidth - 4).Height(m.height - 20).Render("") + + statsHeight := lipgloss.Height(stats) + agentsHeight := lipgloss.Height(agents) + remainingHeight := m.height - statsHeight - agentsHeight - 2 + if remainingHeight < 3 { + remainingHeight = 3 + } + + empty := boxStyle.Width(rightWidth - 4).Height(remainingHeight).Render("") rightPanel := lipgloss.JoinVertical(lipgloss.Left, stats, agents, empty) if m.loading {