fix(ui): only auto-expand pills once per session lifecycle

Andrey Nering created

The auto-expand logic now fires only when the todo/queue panel is first
created, not on subsequent session updates. A `pillsAutoExpanded` guard
flag prevents re-triggering until the next session.

💘 Generated with Crush

Assisted-by: Crush:kimi-k2.6

Change summary

internal/ui/model/pills.go | 4 ++++
internal/ui/model/ui.go    | 2 ++
2 files changed, 6 insertions(+)

Detailed changes

internal/ui/model/pills.go 🔗

@@ -154,7 +154,11 @@ func (m *UI) autoExpandPillsIfReasonable() tea.Cmd {
 	if m.pillsExpanded {
 		return nil
 	}
+	if m.pillsAutoExpanded {
+		return nil
+	}
 	m.pillsExpanded = true
+	m.pillsAutoExpanded = true
 	if hasIncompleteTodos(m.session.Todos) {
 		m.focusedPillSection = pillSectionTodos
 	} else {

internal/ui/model/ui.go 🔗

@@ -259,6 +259,7 @@ type UI struct {
 
 	// pills state
 	pillsExpanded      bool
+	pillsAutoExpanded  bool
 	focusedPillSection pillSection
 	promptQueue        int
 	pillsView          string
@@ -3500,6 +3501,7 @@ func (m *UI) newSession() tea.Cmd {
 	m.chat.Blur()
 	m.chat.ClearMessages()
 	m.pillsExpanded = false
+	m.pillsAutoExpanded = false
 	m.promptQueue = 0
 	m.pillsView = ""
 	m.historyReset()