MCPcopy Index your code
hub / github.com/docker/docker-agent / newView

Method newView

pkg/tui/components/transcript/transcript.go:59–68  ·  view source on GitHub ↗

newView creates the right view for a message, like the message list's createToolCallView / createMessageView helpers.

(msg, prev *types.Message)

Source from the content-addressed store, hash-verified

57// newView creates the right view for a message, like the message list's
58// createToolCallView / createMessageView helpers.
59func (t *Transcript) newView(msg, prev *types.Message) layout.Model {
60 var v layout.Model
61 if msg.Type == types.MessageTypeToolCall {
62 v = tool.New(msg, t.state)
63 } else {
64 v = message.New(msg, prev)
65 }
66 _ = v.SetSize(t.width, 0)
67 return v
68}
69
70func (t *Transcript) lastMsg() *types.Message {
71 if n := len(t.msgs); n > 0 {

Callers 3

AppendMethod · 0.95
refreshToolViewMethod · 0.95
RebuildMethod · 0.95

Calls 3

SetSizeMethod · 0.95
NewFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected