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

Method detailsContent

cmd/root/agent_picker.go:452–461  ·  view source on GitHub ↗

detailsContent returns the text shown in the YAML dialog for a choice.

(choice agentChoice)

Source from the content-addressed store, hash-verified

450
451// detailsContent returns the text shown in the YAML dialog for a choice.
452func (m *agentPickerModel) detailsContent(choice agentChoice) string {
453 switch {
454 case choice.yaml != "":
455 return highlightYAML(strings.TrimRight(choice.yaml, "\n"))
456 case choice.err != nil:
457 return "Failed to load agent:\n\n" + sanitizeYAML(choice.err.Error())
458 default:
459 return "No configuration available."
460 }
461}
462
463// highlightYAML syntax-colorizes YAML using chroma with the active TUI theme.
464// On any tokenisation error it returns the (sanitized) source unchanged.

Callers 2

openDetailsMethod · 0.95
TestDetailsContentFunction · 0.80

Calls 3

highlightYAMLFunction · 0.85
sanitizeYAMLFunction · 0.85
ErrorMethod · 0.45

Tested by 1

TestDetailsContentFunction · 0.64