Skip to content

agent_ui: Auto-expand and then collapse thinking blocks#51525

Merged
danilo-leal merged 1 commit intomainfrom
auto-expand-collapse-thinking
Mar 13, 2026
Merged

agent_ui: Auto-expand and then collapse thinking blocks#51525
danilo-leal merged 1 commit intomainfrom
auto-expand-collapse-thinking

Conversation

@danilo-leal
Copy link
Copy Markdown
Member

With these newer models that come with different thinking levels, it's become more frequent to want to see what the thinking is outputting. Thus far in Zed, the thinking block would show up automatically collapsed and every time you wanted to see it, you had to expand it manually. This PR changes that by making the thinking block automatically expanded instead, but as soon as it's done, it collapses again.

Release Notes:

  • Agent: Improved visibility of thinking blocks by making them auto-expanded while in progress.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 13, 2026
@zed-codeowner-coordinator zed-codeowner-coordinator bot requested review from a team, benbrandt and osyvokon and removed request for a team March 13, 2026 19:22
@zed-community-bot zed-community-bot bot added the staff Pull requests authored by a current member of Zed staff label Mar 13, 2026
@danilo-leal danilo-leal merged commit 0ccdd9b into main Mar 13, 2026
40 checks passed
@danilo-leal danilo-leal deleted the auto-expand-collapse-thinking branch March 13, 2026 20:01
tommyming pushed a commit to tommyming/zed that referenced this pull request Mar 15, 2026
…es#51525)

With these newer models that come with different thinking levels, it's
become more frequent to want to see what the thinking is outputting.
Thus far in Zed, the thinking block would show up automatically
collapsed and every time you wanted to see it, you had to expand it
manually. This PR changes that by making the thinking block
automatically _expanded_ instead, but as soon as it's done, it collapses
again.

Release Notes:

- Agent: Improved visibility of thinking blocks by making them
auto-expanded while in progress.
@tonku321
Copy link
Copy Markdown

tonku321 commented Mar 18, 2026

Screenshot 2026-03-18 at 22 48 43

I think it's a good idea to add the "Expand Thinking Card" setting, similar to the others. @danilo-leal

danilo-leal added a commit that referenced this pull request Mar 30, 2026
Follow up to #51525
Closes #52452

This PR further refines the behavior of thinking blocks in the agent
panel. In the PR linked above, I had previously made it auto-expand
while running but then auto-collapse when finished. Although that
reduced the sense of staleness when the model is thinking for too long,
it caused layout shift that many found jarring.

Therefore, this PR changes the behavior so that, by default, thinking
blocks render "almost" fully expanded. They will have a max-height and
will auto-scroll as content streams in. Therefore, this design fully
removes layout shift and still allows you to sort of follow along the
generated thinking content, even though sometimes it can be fast, in
which case you can always fully expand it. Lastly, I'm also adding a
"thinking display" setting that allows to choose between the "automatic"
behavior (what I just described, the default), always expanded, or
always collapsed.

Here's a preview:


https://github.com/user-attachments/assets/c96c89c7-40ed-4e9b-9ffc-f70b0659be47

Release Notes:

- Agent: Refined thinking block display, removing layout shift while
still allowing it to be readable while it streams in. It comes together
with a "Thinking Display" setting to control the behavior
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants