on main help sign in
fix(scrollbar): only show on human scroll
commitff12fa014e8f530daa8e52eecc716c79d18a363c authorKieran Klukas <kieran@dunkirk.sh> dateTue 30 Jun 2026, 11:01 (3 months ago) parentd8fc48a
2 files changed+9−3
internal/ui/model/chat.go+7−3 internal/ui/model/pills.go+2
internal/ui/model/chat.go+7−3
@@ -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}
internal/ui/model/pills.go+2
@@ -192,6 +192,8 @@ func (m *UI) togglePillsExpanded() tea.Cmd {
192192 m.updateLayoutAndSize()
193193
194194 // Make sure to follow scroll if follow is enabled when toggling pills.
195+ // Note: uses ScrollToBottom (no scrollbar) since this is layout adjustment,
196+ // not user-initiated scrolling.
195197 if m.chat.Follow() {
196198 m.chat.ScrollToBottom()
197199 }