refreshToolView applies a status to tool message i and recreates its view.
(i int, status types.ToolStatus)
| 152 | |
| 153 | // refreshToolView applies a status to tool message i and recreates its view. |
| 154 | func (t *Transcript) refreshToolView(i int, status types.ToolStatus) tea.Cmd { |
| 155 | msg := t.msgs[i] |
| 156 | msg.ToolStatus = status |
| 157 | if status == types.ToolStatusRunning && msg.StartedAt == nil { |
| 158 | now := time.Now() |
| 159 | msg.StartedAt = &now |
| 160 | } |
| 161 | animation.StopView(t.views[i]) |
| 162 | var prev *types.Message |
| 163 | if i > 0 { |
| 164 | prev = t.msgs[i-1] |
| 165 | } |
| 166 | t.views[i] = t.newView(msg, prev) |
| 167 | return t.views[i].Init() |
| 168 | } |
| 169 | |
| 170 | // LastIs reports whether the most recent message has the given type. |
| 171 | func (t *Transcript) LastIs(typ types.MessageType) bool { |
no test coverage detected