@@ -302,6 +302,7 @@ func (m *Chat) InvalidateRenderCaches() {
302func (m *Chat) SetMessages(msgs ...chat.MessageItem) tea.Cmd {
302func (m *Chat) SetMessages(msgs ...chat.MessageItem) tea.Cmd {
303 m.idInxMap = make(map[string]int)
303 m.idInxMap = make(map[string]int)
304 m.pausedAnimations = make(map[string]struct{})
304 m.pausedAnimations = make(map[string]struct{})
305+ m.scrollbarVisible = false // Reset scrollbar visibility on new session load
306 items := make([]list.Item, len(msgs))
307 items := make([]list.Item, len(msgs))
307 for i, msg := range msgs {
308 for i, msg := range msgs {
@@ -315,7 +316,8 @@ func (m *Chat) SetMessages(msgs ...chat.MessageItem) tea.Cmd {
315 items[i] = msg
316 items[i] = msg
317 m.list.SetItems(items...)
318 m.list.SetItems(items...)
318− return m.ScrollToBottom()
319+ m.ScrollToBottom()
321// AppendMessages appends a new message item to the chat list.
323// AppendMessages appends a new message item to the chat list.
@@ -446,10 +448,11 @@ func (m *Chat) Follow() bool {
448// ScrollToBottom scrolls the chat view to the bottom.
450// ScrollToBottom scrolls the chat view to the bottom.
451+// Does not trigger scrollbar visibility (auto-scroll to show new content).
449func (m *Chat) ScrollToBottom() tea.Cmd {
452func (m *Chat) ScrollToBottom() tea.Cmd {
450 m.list.ScrollToBottom()
453 m.list.ScrollToBottom()
451− m.follow = true // Enable follow mode when user scrolls to bottom
454+ m.follow = true
452− return m.showScrollbar()
455+ return nil
455// ScrollToTop scrolls the chat view to the top.
458// ScrollToTop scrolls the chat view to the top.
@@ -652,6 +655,7 @@ func (m *Chat) SelectLastInView() {
652func (m *Chat) ClearMessages() {
655func (m *Chat) ClearMessages() {
653 m.idInxMap = make(map[string]int)
656 m.idInxMap = make(map[string]int)
654 m.pausedAnimations = make(map[string]struct{})
657 m.pausedAnimations = make(map[string]struct{})
658+ m.scrollbarVisible = false
655 m.list.SetItems()
659 m.list.SetItems()
656 m.ClearMouse()
660 m.ClearMouse()