@@ -139,11 +139,6 @@ func (m *UI) togglePillsExpanded() tea.Cmd {
139139 if !m.hasSession() {
140140 return nil
141141 }
142− if m.layout.pills.Dy() > 0 {
143− if cmd := m.chat.ScrollByAndAnimate(0); cmd != nil {
144− return cmd
145− }
146− }
147142 hasPills := hasIncompleteTodos(m.session.Todos) || m.promptQueue > 0
148143 if !hasPills {
149144 return nil
@@ -157,6 +152,12 @@ func (m *UI) togglePillsExpanded() tea.Cmd {
157152 }
158153 }
159154 m.updateLayoutAndSize()
155+
156+ // Make sure to follow scroll if follow is enabled when toggling pills.
157+ if m.chat.Follow() {
158+ m.chat.ScrollToBottom()
159+ }
160+
160161 return nil
161162}
162163