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

Quick follow up to https://github.com/zed-industries/zed/pull/52874
where expanded thinking blocks, when in auto-mode, wouldn't collapse
again.

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2026-04-01 14:38:24 -03:00 committed by GitHub
parent 2a15bf630d
commit ed97a043a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);