fix(tui): ensure viewport scrolls to bottom on new messages (#1110)

This commit is contained in:
Tom 2025-07-18 16:41:03 +07:00 committed by GitHub
parent 99b9390d80
commit 81c88cc742
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -393,6 +393,9 @@ func (m *messagesComponent) renderView() {
m.viewport.SetHeight(m.height - lipgloss.Height(m.header))
m.viewport.SetContent("\n" + strings.Join(blocks, "\n\n"))
if m.tail {
m.viewport.GotoBottom()
}
}
func (m *messagesComponent) renderHeader() string {