MCPcopy Index your code
hub / github.com/codehamr/codehamr / Update

Method Update

internal/tui/model.go:380–389  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
380func (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
391func (m Model) update(msg tea.Msg) (tea.Model, tea.Cmd) {
392 switch msg := msg.(type) {

Calls 2

updateMethod · 0.95
wrapForScrollbackFunction · 0.85