Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/conversation/transcript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -810,20 +810,19 @@ impl Desktop {
cx: &mut Context<Self>,
) -> Div {
let gap = rems(0.5).to_pixels(window.rem_size());
let padding = rems(0.75).to_pixels(window.rem_size());
let padding = rems(1.).to_pixels(window.rem_size());
let count = suggestions.len() as f32;
let label_width = ((width - gap * (count - 1.)) / count - padding).max(px(0.));
let can_send = self.can_send_suggested_reply(cx);
h_flex()
.w(width)
let buttons = h_flex()
.w_full()
.gap(gap)
.children(suggestions.iter().enumerate().map(|(index, suggestion)| {
let label = SharedString::from(suggestion.label.trim().to_owned());
let prompt = suggestion.prompt.trim().to_owned();
control!(
label.clone(),
Button::new(("follow-up", index))
.small()
.compact()
.tab_stop(true)
.disabled(!can_send)
Expand All @@ -846,7 +845,12 @@ impl Desktop {
}
}))
)
}))
}));
v_flex()
.w(width)
.gap_1()
.child(crate::ui::section_title("What's next?").text_color(transcript_muted(cx)))
.child(buttons)
}

fn can_send_suggested_reply(&self, cx: &App) -> bool {
Expand Down
Loading