on main help sign in
chore(chat): add some missing docs
commit95bae1017e11e4312ef98d78eed21eceb2211087 authorKujtim Hoxha <kujtimii.h@gmail.com> dateWed 17 Dec 2025, 16:41 (1 year ago) parent3d9d4e6
2 files changed+7
internal/ui/chat/messages.go+4 internal/ui/model/ui.go+3
internal/ui/chat/messages.go+4
@@ -163,6 +163,10 @@ func GetMessageItems(sty *styles.Styles, msg *message.Message, toolResults map[s
163163 return []MessageItem{}
164164}
165165
166+// shouldRenderAssistantMessage determines if an assistant message should be rendered
167+//
168+// In some cases the assistant message only has tools so we do not want to render an
169+// empty message.
166170func shouldRenderAssistantMessage(msg *message.Message) bool {
167171 content := strings.TrimSpace(msg.Content().Text)
168172 thinking := strings.TrimSpace(msg.ReasoningContent().Thinking)
internal/ui/model/ui.go+3
@@ -384,6 +384,7 @@ func (m *UI) setSessionMessages(msgs []message.Message) tea.Cmd {
384384 return tea.Batch(cmds...)
385385}
386386
387+// appendSessionMessage appends a new message to the current session in the chat
387388func (m *UI) appendSessionMessage(msg message.Message) tea.Cmd {
388389 items := chat.GetMessageItems(m.com.Styles, &msg, nil)
389390 var cmds []tea.Cmd
@@ -399,6 +400,8 @@ func (m *UI) appendSessionMessage(msg message.Message) tea.Cmd {
399400 return tea.Batch(cmds...)
400401}
401402
403+// updateSessionMessage updates an existing message in the current session in the chat
404+// INFO: currently only updates the assistant when I add tools this will get a bit more complex
402405func (m *UI) updateSessionMessage(msg message.Message) tea.Cmd {
403406 existingItem := m.chat.GetMessageItem(msg.ID)
404407 switch msg.Role {