Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent_ui: Fix collapsing bug with thinking blocks in auto-mode (#52916)

Danilo Lealed97a043a17c
diff --git a/crates/agent_ui/src/conversation_view/thread_view.rs b/crates/agent_ui/src/conversation_view/thread_view.rs
index 1782f7230e1..c065c3de3d8 100644
--- a/crates/agent_ui/src/conversation_view/thread_view.rs
+++ b/crates/agent_ui/src/conversation_view/thread_view.rs
@@ -5207,9 +5207,12 @@ impl ThreadView {
match thinking_display {
ThinkingBlockDisplay::Auto => {
- if self.expanded_thinking_blocks.contains(&key) {
+ let is_open = self.expanded_thinking_blocks.contains(&key)
+ || self.user_toggled_thinking_blocks.contains(&key);
+
+ if is_open {
self.expanded_thinking_blocks.remove(&key);
- self.user_toggled_thinking_blocks.insert(key);
+ self.user_toggled_thinking_blocks.remove(&key);
} else {
self.expanded_thinking_blocks.insert(key);
self.user_toggled_thinking_blocks.insert(key);