MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / setConversationContent

Method setConversationContent

internal/ui/program.go:892–909  ·  view source on GitHub ↗

setConversationContent pushes the current scrollback buffer into the viewport, wrapping it to the viewport's width first so long lines (file output, JSON in errors, etc.) snap to the panel instead of trailing off the right edge. The wrap is ANSI-aware via lipgloss, so turn dividers, tool logs, and t

()

Source from the content-addressed store, hash-verified

890// can collapse during its wrap pass. We pass the banner through unchanged
891// and only wrap what comes after it.
892func (m *harness) setConversationContent() {
893 w := m.viewport.Width
894 content := m.output.String()
895 if w <= 0 {
896 m.viewport.SetContent(content)
897 return
898 }
899 if m.bannerEnd > 0 && m.bannerEnd <= len(content) {
900 banner := content[:m.bannerEnd]
901 rest := content[m.bannerEnd:]
902 if rest != "" {
903 rest = lipgloss.NewStyle().Width(w).Render(rest)
904 }
905 m.viewport.SetContent(banner + rest)
906 return
907 }
908 m.viewport.SetContent(lipgloss.NewStyle().Width(w).Render(content))
909}
910
911// renderTurnHeader returns a "── 15:23:45 ─────────…" divider sized to
912// width. Called when the user submits a new prompt so each turn has an

Callers 3

UpdateMethod · 0.95
updateInputMethod · 0.95
updateApprovalMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected