@@ -302,6 +302,7 @@ func (m *Chat) InvalidateRenderCaches() {
302302func (m *Chat) SetMessages(msgs ...chat.MessageItem) tea.Cmd {
303303 m.idInxMap = make(map[string]int)
304304 m.pausedAnimations = make(map[string]struct{})
305+ m.scrollbarVisible = false // Reset scrollbar visibility on new session load
305306
306307 items := make([]list.Item, len(msgs))
307308 for i, msg := range msgs {
@@ -315,7 +316,8 @@ func (m *Chat) SetMessages(msgs ...chat.MessageItem) tea.Cmd {
315316 items[i] = msg
316317 }
317318 m.list.SetItems(items...)
318− return m.ScrollToBottom()
319+ m.ScrollToBottom()
320+ return nil
319321}
320322
321323// AppendMessages appends a new message item to the chat list.
@@ -446,10 +448,11 @@ func (m *Chat) Follow() bool {
446448}
447449
448450// ScrollToBottom scrolls the chat view to the bottom.
451+// Does not trigger scrollbar visibility (auto-scroll to show new content).
449452func (m *Chat) ScrollToBottom() tea.Cmd {
450453 m.list.ScrollToBottom()
451− m.follow = true // Enable follow mode when user scrolls to bottom
452− return m.showScrollbar()
454+ m.follow = true
455+ return nil
453456}
454457
455458// ScrollToTop scrolls the chat view to the top.
@@ -652,6 +655,7 @@ func (m *Chat) SelectLastInView() {
652655func (m *Chat) ClearMessages() {
653656 m.idInxMap = make(map[string]int)
654657 m.pausedAnimations = make(map[string]struct{})
658+ m.scrollbarVisible = false
655659 m.list.SetItems()
656660 m.ClearMouse()
657661}