diff --git a/src/app/view/chat.rs b/src/app/view/chat.rs index 35bf952..6dcd06f 100644 --- a/src/app/view/chat.rs +++ b/src/app/view/chat.rs @@ -55,6 +55,7 @@ impl App { .spacing(8), ); } else { + let markdown_style = markdown::Style::from_palette(app_theme().palette()); for (index, message) in self.conversation.iter().enumerate() { if message.compaction { messages = messages.push( @@ -123,17 +124,29 @@ impl App { } } if !message.content.is_empty() { - body = body.push( - text_editor(&message.transcript) - .id(iced::widget::Id::from(format!( - "transcript-{}-{index}", - message.id - ))) - .on_action(move |action| Message::TranscriptAction(index, action)) - .padding(0) - .size(14) - .style(selectable_text_style), - ); + if message.user || message.tool || message.markdown.items().is_empty() { + body = body.push( + text_editor(&message.transcript) + .id(iced::widget::Id::from(format!( + "transcript-{}-{index}", + message.id + ))) + .on_action(move |action| { + Message::TranscriptAction(index, action) + }) + .padding(0) + .size(14) + .style(selectable_text_style), + ); + } else { + body = body.push( + markdown::view( + message.markdown.items(), + markdown::Settings::with_text_size(14, markdown_style), + ) + .map(Message::OpenLink), + ); + } } else if active && message.reasoning.is_none() { body = body.push( text(self.activity.as_deref().unwrap_or("Loading model…")).size(14),