@@ -384,6 +384,7 @@ func (m *UI) setSessionMessages(msgs []message.Message) tea.Cmd {
384 return tea.Batch(cmds...)
384 return tea.Batch(cmds...)
387+// appendSessionMessage appends a new message to the current session in the chat
387func (m *UI) appendSessionMessage(msg message.Message) tea.Cmd {
388func (m *UI) appendSessionMessage(msg message.Message) tea.Cmd {
388 items := chat.GetMessageItems(m.com.Styles, &msg, nil)
389 items := chat.GetMessageItems(m.com.Styles, &msg, nil)
389 var cmds []tea.Cmd
390 var cmds []tea.Cmd
@@ -399,6 +400,8 @@ func (m *UI) appendSessionMessage(msg message.Message) tea.Cmd {
399 return tea.Batch(cmds...)
400 return tea.Batch(cmds...)
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
402func (m *UI) updateSessionMessage(msg message.Message) tea.Cmd {
405func (m *UI) updateSessionMessage(msg message.Message) tea.Cmd {
403 existingItem := m.chat.GetMessageItem(msg.ID)
406 existingItem := m.chat.GetMessageItem(msg.ID)
404 switch msg.Role {
407 switch msg.Role {