acp: Hide loading diff animation for external agents and update in place (#36699)

The loading diff animation can be jarring for external agents because
they stream the diff at the same time the tool call is pushed, so it's
only displayed while we're asynchronously calculating the diff. We'll
now only show it for the native agent.

Also, we'll now only update the diff when it changes, which avoids
unnecessarily hiding it for a few frames.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
Agus Zubiaga 2025-08-21 16:56:15 -03:00 committed by GitHub
parent d0583ede48
commit 725ed5dd01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 85 additions and 21 deletions

View file

@ -1625,7 +1625,9 @@ impl AcpThreadView {
.into_any()
}
ToolCallStatus::Pending | ToolCallStatus::InProgress
if is_edit && tool_call.content.is_empty() =>
if is_edit
&& tool_call.content.is_empty()
&& self.as_native_connection(cx).is_some() =>
{
self.render_diff_loading(cx).into_any()
}
@ -1981,7 +1983,7 @@ impl AcpThreadView {
&& diff.read(cx).has_revealed_range(cx)
{
editor.into_any_element()
} else if tool_progress {
} else if tool_progress && self.as_native_connection(cx).is_some() {
self.render_diff_loading(cx)
} else {
Empty.into_any()