From 8d543a7020ddf728328547b53c1fa66a59922676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E6=A3=AE?= Date: Sun, 10 May 2026 14:44:38 +0800 Subject: [PATCH] fix: remove textarea resize from View() and fix right panel height --- internal/tui/model.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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 {