detailsContent returns the text shown in the YAML dialog for a choice.
(choice agentChoice)
| 450 | |
| 451 | // detailsContent returns the text shown in the YAML dialog for a choice. |
| 452 | func (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. |