acp: Polish UI (#36927)

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Bennet Bo Fenner 2025-08-26 12:55:45 +02:00 committed by GitHub
parent b249593abe
commit e96b68bc15
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 6 deletions

View file

@ -472,7 +472,7 @@ async fn test_tool_authorization(cx: &mut TestAppContext) {
tool_name: ToolRequiringPermission::name().into(), tool_name: ToolRequiringPermission::name().into(),
is_error: true, is_error: true,
content: "Permission to run tool denied by user".into(), content: "Permission to run tool denied by user".into(),
output: None output: Some("Permission to run tool denied by user".into())
}) })
] ]
); );

View file

@ -732,7 +732,17 @@ impl Thread {
stream.update_tool_call_fields( stream.update_tool_call_fields(
&tool_use.id, &tool_use.id,
acp::ToolCallUpdateFields { acp::ToolCallUpdateFields {
status: Some(acp::ToolCallStatus::Completed), status: Some(
tool_result
.as_ref()
.map_or(acp::ToolCallStatus::Failed, |result| {
if result.is_error {
acp::ToolCallStatus::Failed
} else {
acp::ToolCallStatus::Completed
}
}),
),
raw_output: output, raw_output: output,
..Default::default() ..Default::default()
}, },
@ -1557,7 +1567,7 @@ impl Thread {
tool_name: tool_use.name, tool_name: tool_use.name,
is_error: true, is_error: true,
content: LanguageModelToolResultContent::Text(Arc::from(error.to_string())), content: LanguageModelToolResultContent::Text(Arc::from(error.to_string())),
output: None, output: Some(error.to_string().into()),
}, },
} }
})) }))

View file

@ -1684,7 +1684,7 @@ impl AcpThreadView {
div() div()
.relative() .relative()
.mt_1p5() .mt_1p5()
.ml(px(7.)) .ml(rems(0.4))
.pl_4() .pl_4()
.border_l_1() .border_l_1()
.border_color(self.tool_card_border_color(cx)) .border_color(self.tool_card_border_color(cx))
@ -1850,6 +1850,7 @@ impl AcpThreadView {
.w_full() .w_full()
.h(window.line_height() - px(2.)) .h(window.line_height() - px(2.))
.text_size(self.tool_name_font_size()) .text_size(self.tool_name_font_size())
.gap_0p5()
.child(tool_icon) .child(tool_icon)
.child(if tool_call.locations.len() == 1 { .child(if tool_call.locations.len() == 1 {
let name = tool_call.locations[0] let name = tool_call.locations[0]
@ -1968,7 +1969,7 @@ impl AcpThreadView {
v_flex() v_flex()
.mt_1p5() .mt_1p5()
.ml(px(7.)) .ml(rems(0.4))
.px_3p5() .px_3p5()
.gap_2() .gap_2()
.border_l_1() .border_l_1()
@ -2025,7 +2026,7 @@ impl AcpThreadView {
let button_id = SharedString::from(format!("item-{}", uri)); let button_id = SharedString::from(format!("item-{}", uri));
div() div()
.ml(px(7.)) .ml(rems(0.4))
.pl_2p5() .pl_2p5()
.border_l_1() .border_l_1()
.border_color(self.tool_card_border_color(cx)) .border_color(self.tool_card_border_color(cx))