fix: markdown rendering for chat was broken
This commit is contained in:
@@ -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() {
|
||||
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))
|
||||
.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),
|
||||
|
||||
Reference in New Issue
Block a user