@@ -47,6 +47,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
4747 // -- Frame tick (60fps) — rebuild streaming entries for live updates ------
4848 case tickMsg:
4949 m.tickStreaming()
50+ m.tickSpinner(time.Time(msg))
5051 return m, frameTick()
5152
5253 // -- LLM batch (multiple messages drained from updateChan) ---------------
@@ -55,6 +56,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
5556
5657 // -- LLM user message (sent before streaming begins) ---------------------
5758 case llmUserMsg:
59+ m.llmInFlight = true
5860 return m.handleUserMsg(msg), tea.Batch(m.processLLM(), m.waitForLLMUpdate())
5961
6062 case LSPDiagnosticsMsg:
@@ -71,22 +73,23 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
7173
7274 case undoMsg:
7375 return m.handleUndo(), nil
76+
77+ case gitBranchMsg:
78+ return m.handleGitBranch(msg)
7479 }
7580
76- // Always tick spinner
81+ // Forward remaining messages to sub-models (mouse is already handled above).
82+ return m.forwardToSubModels(msg)
83+}
84+
85+// forwardToSubModels sends a non-handled message to sub-editors.
86+func (m Model) forwardToSubModels(msg tea.Msg) (tea.Model, tea.Cmd) {
7787 var cmds []tea.Cmd
7888 var cmd tea.Cmd
79- m.spinner, cmd = m.spinner.Update(msg)
89+ m.editor, cmd = m.editor.Update(msg)
90+ cmds = append(cmds, cmd)
91+ m.agentInput, cmd = m.agentInput.Update(msg)
8092 cmds = append(cmds, cmd)
81-
82- // Forward non-mouse messages to focused component
83- if _, isMouse := msg.(tea.MouseMsg); !isMouse {
84- m.editor, cmd = m.editor.Update(msg)
85- cmds = append(cmds, cmd)
86- m.agentInput, cmd = m.agentInput.Update(msg)
87- cmds = append(cmds, cmd)
88- }
89-
9093 return m, tea.Batch(cmds...)
9194 }
9295
@@ -94,10 +97,29 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
9497 func (m *Model) handleLSPDiag(msg LSPDiagnosticsMsg) Model {
9598 if msg.FilePath == m.editorFilePath {
9699 m.editor.DiagnosticLines = msg.Lines
100+ // Count errors (severity 1) and warnings (severity 2) for the statusbar.
101+ errs, warns := 0, 0
102+ for _, sev := range msg.Lines {
103+ switch sev {
104+ case 1:
105+ errs++
106+ case 2:
107+ warns++
108+ }
109+ }
110+ m.lspErrors = errs
111+ m.lspWarnings = warns
97112 }
98113 return *m
99114 }
100115
116+// handleGitBranch updates statusbar git state and schedules the next poll.
117+func (m Model) handleGitBranch(msg gitBranchMsg) (tea.Model, tea.Cmd) {
118+ m.gitBranch = msg.branch
119+ m.gitDirty = msg.dirty
120+ return m, gitBranchTick()
121+}
122+
101123 // handleResize applies a window size change and re-derives layout.
102124 func (m *Model) handleResize(msg tea.WindowSizeMsg) {
103125 m.width, m.height = msg.Width, msg.Height
@@ -233,6 +255,9 @@ func (m Model) handleLLMBatch(batch llmBatchMsg) (tea.Model, tea.Cmd) {
233255 m.applyToolResultMsg(msg)
234256
235257 case llmErrorMsg:
258+ m.llmInFlight = false
259+ m.lastNetError = msg.err.Error()
260+ m.clearStreaming()
236261 m.appendText("", m.styles.Error.Render("Error: "+msg.err.Error()), "")
237262 return m, nil
238263
@@ -243,6 +268,8 @@ func (m Model) handleLLMBatch(batch llmBatchMsg) (tea.Model, tea.Cmd) {
243268 m.totalOutputTokens += msg.outputTokens
244269
245270 case llmDoneMsg:
271+ m.llmInFlight = false
272+ m.lastNetError = ""
246273 m.demoteOldUndo()
247274 m.appendText("")
248275 sep := m.makeSeparator(msg.duration.Round(time.Second).String(), msg.timestamp,
@@ -257,6 +284,22 @@ func (m Model) handleLLMBatch(batch llmBatchMsg) (tea.Model, tea.Cmd) {
257284 return m, m.waitForLLMUpdate()
258285 }
259286
287+// brailleFrames is the spinner animation sequence.
288+var brailleFrames = []string{"⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"}
289+
290+// tickSpinner advances the braille spinner frame based on elapsed time.
291+// Slow (~500ms/frame) when idle, fast (~100ms/frame) during LLM turns.
292+func (m *Model) tickSpinner(now time.Time) {
293+ interval := 500 * time.Millisecond
294+ if m.llmInFlight {
295+ interval = 100 * time.Millisecond
296+ }
297+ if now.Sub(m.spinFrameAt) >= interval {
298+ m.spinFrame = (m.spinFrame + 1) % len(brailleFrames)
299+ m.spinFrameAt = now
300+ }
301+}
302+
260303 // tickStreaming rebuilds streaming entries when new content has arrived.
261304 func (m *Model) tickStreaming() {
262305 if m.streamDirty {