Skip to content

Commit 81c88cc

Browse files
authored
fix(tui): ensure viewport scrolls to bottom on new messages (#1110)
1 parent 99b9390 commit 81c88cc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/tui/internal/components/chat/messages.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,9 @@ func (m *messagesComponent) renderView() {
393393

394394
m.viewport.SetHeight(m.height - lipgloss.Height(m.header))
395395
m.viewport.SetContent("\n" + strings.Join(blocks, "\n\n"))
396+
if m.tail {
397+
m.viewport.GotoBottom()
398+
}
396399
}
397400

398401
func (m *messagesComponent) renderHeader() string {

0 commit comments

Comments
 (0)