MCPcopy
hub / github.com/docker/docker-agent / Rebuild

Method Rebuild

pkg/tui/components/transcript/transcript.go:246–259  ·  view source on GitHub ↗

Rebuild recreates every view from its message, dropping all cached rendered output. Use it on theme change: the views memoize rendered ANSI, so a style swap must start from scratch. Returns the new views' Init commands (re-arming spinner animations).

()

Source from the content-addressed store, hash-verified

244// ANSI, so a style swap must start from scratch. Returns the new views'
245// Init commands (re-arming spinner animations).
246func (t *Transcript) Rebuild() tea.Cmd {
247 t.StopAnimations()
248 var cmds []tea.Cmd
249 var prev *types.Message
250 for i, msg := range t.msgs {
251 v := t.newView(msg, prev)
252 t.views[i] = v
253 if cmd := v.Init(); cmd != nil {
254 cmds = append(cmds, cmd)
255 }
256 prev = msg
257 }
258 return tea.Batch(cmds...)
259}
260
261// StopAnimations unregisters every view from the animation coordinator.
262// Call it when the host view goes away (e.g. the embedding dialog closes)

Callers 1

Calls 4

StopAnimationsMethod · 0.95
newViewMethod · 0.95
BatchMethod · 0.80
InitMethod · 0.65

Tested by 1