Update is the bubbletea entry point: it dispatches to update()'s typed handlers then drains the outbox into a single tea.Println, so lines land in scrollback in the exact order appendLine / flushStreaming queued them. One Println per cycle, never a Batch; Batch runs children concurrently, leaving ar
(msg tea.Msg)
| 378 | // Println per cycle, never a Batch; Batch runs children concurrently, leaving |
| 379 | // arrival order undefined, so splash lines and tool-call banners would shuffle. |
| 380 | func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { |
| 381 | next, cmd := m.update(msg) |
| 382 | nm := next.(Model) |
| 383 | if len(nm.outbox) > 0 { |
| 384 | printCmd := tea.Println(wrapForScrollback(strings.Join(nm.outbox, "\n"), nm.width)) |
| 385 | nm.outbox = nil |
| 386 | cmd = tea.Batch(printCmd, cmd) |
| 387 | } |
| 388 | return nm, cmd |
| 389 | } |
| 390 | |
| 391 | func (m Model) update(msg tea.Msg) (tea.Model, tea.Cmd) { |
| 392 | switch msg := msg.(type) { |