fix: header visibility with bottom border and dynamic height

This commit is contained in:
大森 2026-05-10 14:50:04 +08:00
parent 6cd0a8d021
commit 8619a7f35c

View File

@ -267,16 +267,16 @@ func (m Model) View() string {
rightWidth := 42
leftWidth := m.width - rightWidth - 3
headerHeight := 3
mainHeight := m.height - headerHeight - 1
header := m.renderHeader()
headerHeight := lipgloss.Height(header)
mainHeight := m.height - headerHeight
inputHeight := 5
chatHeight := mainHeight - inputHeight
if chatHeight < 10 {
chatHeight = 10
}
header := m.renderHeader()
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)
@ -307,9 +307,10 @@ func (m Model) renderHeader() string {
title := titleStyle.Render("orca.agent ") + mutedStyle.Render(version)
return lipgloss.NewStyle().
Width(m.width).
Height(1).
Padding(0, 1).
Background(lipgloss.Color(colors.bg)).
BorderBottom(true).
BorderStyle(lipgloss.NormalBorder()).
BorderForeground(lipgloss.Color(colors.border)).
Render(title)
}