on main help sign in
chore(chat): some more docs missing
b8d39c6Kujtim Hoxha
internal/ui/chat/assistant.go+3
@@ -52,6 +52,7 @@ func NewAssistantMessageItem(sty *styles.Styles, message *message.Message) Messa
52 return a
52 return a
53}
53}
54
54
55+// StartAnimation starts the assistant message animation if it should be spinning.
55func (a *AssistantMessageItem) StartAnimation() tea.Cmd {
56func (a *AssistantMessageItem) StartAnimation() tea.Cmd {
56 if !a.isSpinning() {
57 if !a.isSpinning() {
57 return nil
58 return nil
@@ -59,6 +60,7 @@ func (a *AssistantMessageItem) StartAnimation() tea.Cmd {
59 return a.anim.Start()
60 return a.anim.Start()
60}
61}
61
62
63+// Animate progresses the assistant message animation if it should be spinning.
62func (a *AssistantMessageItem) Animate(msg anim.StepMsg) tea.Cmd {
64func (a *AssistantMessageItem) Animate(msg anim.StepMsg) tea.Cmd {
63 if !a.isSpinning() {
65 if !a.isSpinning() {
64 return nil
66 return nil
@@ -103,6 +105,7 @@ func (a *AssistantMessageItem) Render(width int) string {
103 return style.Render(highlightedContent)
105 return style.Render(highlightedContent)
104}
106}
105
107
108+// renderMessageContent renders the message content including thinking, main content, and finish reason.
106func (a *AssistantMessageItem) renderMessageContent(width int) string {
109func (a *AssistantMessageItem) renderMessageContent(width int) string {
107 var messageParts []string
110 var messageParts []string
108 thinking := strings.TrimSpace(a.message.ReasoningContent().Thinking)
111 thinking := strings.TrimSpace(a.message.ReasoningContent().Thinking)