assistant2: Remove check icon from successful tool calls (#27840)
Just to streamline the UI more. Release Notes: - N/A
This commit is contained in:
parent
a24fc5a1a5
commit
7d67bd480b
1 changed files with 38 additions and 21 deletions
|
@ -1420,26 +1420,31 @@ impl ActiveThread {
|
||||||
.copied()
|
.copied()
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let status_icons = div().child({
|
let is_status_finished = matches!(&tool_use.status, ToolUseStatus::Finished(_));
|
||||||
let (icon_name, color, animated) = match &tool_use.status {
|
|
||||||
ToolUseStatus::Pending | ToolUseStatus::NeedsConfirmation => {
|
|
||||||
(IconName::Warning, Color::Warning, false)
|
|
||||||
}
|
|
||||||
ToolUseStatus::Running => (IconName::ArrowCircle, Color::Accent, true),
|
|
||||||
ToolUseStatus::Finished(_) => (IconName::Check, Color::Success, false),
|
|
||||||
ToolUseStatus::Error(_) => (IconName::Close, Color::Error, false),
|
|
||||||
};
|
|
||||||
|
|
||||||
let icon = Icon::new(icon_name).color(color).size(IconSize::Small);
|
let status_icons = div().child(match &tool_use.status {
|
||||||
|
ToolUseStatus::Pending | ToolUseStatus::NeedsConfirmation => {
|
||||||
if animated {
|
let icon = Icon::new(IconName::Warning)
|
||||||
|
.color(Color::Warning)
|
||||||
|
.size(IconSize::Small);
|
||||||
|
icon.into_any_element()
|
||||||
|
}
|
||||||
|
ToolUseStatus::Running => {
|
||||||
|
let icon = Icon::new(IconName::ArrowCircle)
|
||||||
|
.color(Color::Accent)
|
||||||
|
.size(IconSize::Small);
|
||||||
icon.with_animation(
|
icon.with_animation(
|
||||||
"arrow-circle",
|
"arrow-circle",
|
||||||
Animation::new(Duration::from_secs(2)).repeat(),
|
Animation::new(Duration::from_secs(2)).repeat(),
|
||||||
|icon, delta| icon.transform(Transformation::rotate(percentage(delta))),
|
|icon, delta| icon.transform(Transformation::rotate(percentage(delta))),
|
||||||
)
|
)
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
} else {
|
}
|
||||||
|
ToolUseStatus::Finished(_) => div().w_0().into_any_element(),
|
||||||
|
ToolUseStatus::Error(_) => {
|
||||||
|
let icon = Icon::new(IconName::Close)
|
||||||
|
.color(Color::Error)
|
||||||
|
.size(IconSize::Small);
|
||||||
icon.into_any_element()
|
icon.into_any_element()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1531,23 +1536,29 @@ impl ActiveThread {
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|
||||||
fn gradient_overlay(color: Hsla) -> impl IntoElement {
|
let gradient_overlay = |color: Hsla| {
|
||||||
div()
|
div()
|
||||||
.h_full()
|
.h_full()
|
||||||
.absolute()
|
.absolute()
|
||||||
.w_8()
|
.w_8()
|
||||||
.bottom_0()
|
.bottom_0()
|
||||||
.right_12()
|
.map(|element| {
|
||||||
|
if is_status_finished {
|
||||||
|
element.right_7()
|
||||||
|
} else {
|
||||||
|
element.right_12()
|
||||||
|
}
|
||||||
|
})
|
||||||
.bg(linear_gradient(
|
.bg(linear_gradient(
|
||||||
90.,
|
90.,
|
||||||
linear_color_stop(color, 1.),
|
linear_color_stop(color, 1.),
|
||||||
linear_color_stop(color.opacity(0.2), 0.),
|
linear_color_stop(color.opacity(0.2), 0.),
|
||||||
))
|
))
|
||||||
}
|
};
|
||||||
|
|
||||||
div().map(|this| {
|
div().map(|element| {
|
||||||
if !tool_use.needs_confirmation {
|
if !tool_use.needs_confirmation {
|
||||||
this.py_2p5().child(
|
element.py_2p5().child(
|
||||||
v_flex()
|
v_flex()
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
@ -1557,7 +1568,7 @@ impl ActiveThread {
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.opacity(0.8)
|
.opacity(0.8)
|
||||||
.hover(|style| style.opacity(1.))
|
.hover(|style| style.opacity(1.))
|
||||||
.pr_2()
|
.when(!is_status_finished, |this| this.pr_2())
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
.id("tool-label-container")
|
.id("tool-label-container")
|
||||||
|
@ -1619,7 +1630,7 @@ impl ActiveThread {
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
this.py_2().child(
|
element.py_2().child(
|
||||||
v_flex()
|
v_flex()
|
||||||
.rounded_lg()
|
.rounded_lg()
|
||||||
.border_1()
|
.border_1()
|
||||||
|
@ -1632,7 +1643,13 @@ impl ActiveThread {
|
||||||
.gap_1p5()
|
.gap_1p5()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.py_1()
|
.py_1()
|
||||||
.px_2()
|
.map(|element| {
|
||||||
|
if is_status_finished {
|
||||||
|
element.pl_2().pr_0p5()
|
||||||
|
} else {
|
||||||
|
element.px_2()
|
||||||
|
}
|
||||||
|
})
|
||||||
.bg(self.tool_card_header_bg(cx))
|
.bg(self.tool_card_header_bg(cx))
|
||||||
.map(|element| {
|
.map(|element| {
|
||||||
if is_open {
|
if is_open {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue