agent_ui: Add more refinements to the thinking block display (#52874)
Danilo Leal
created
Follow-up to https://github.com/zed-industries/zed/pull/52608
This PR adds a new iteration to the thinking block display design after
some internal round of feedback. It turns out, we had some people
appreciating the auto-collapse when thinking is done; thinking content
isn't too useful afterwards and it is just more content _to to he
model_, not the user. I also liked the one old but it definitely has the
issue of being a jarring layout shift when it wraps up. So that's why
I'm keeping what I introduced in the PR linked above as a setting, so
that anyone who feels strongly about the default (auto-expand, and
auto-collapse) can change that.
Release Notes:
- N/A
@@ -1117,8 +1117,8 @@
"expand_terminal_card": true,
// How thinking blocks should be displayed by default in the agent panel.
//
- // Default: automatic- "thinking_display": "automatic",
+ // Default: auto
+ "thinking_display": "auto",
// Whether clicking the stop button on a running terminal tool should also cancel the agent's generation.
// Note that this only applies to the stop button, not to ctrl+c inside the terminal.
//
@@ -81,11 +81,14 @@ pub enum SidebarSide {
)]
#[serde(rename_all = "snake_case")]
pub enum ThinkingBlockDisplay {
+ /// Thinking blocks fully expand during streaming, then auto-collapse
+ /// when the model finishes thinking. Users can re-expand after collapse.
+ #[default]
+ Auto,
/// Thinking blocks auto-expand with a height constraint during streaming,
/// then remain in their constrained state when complete. Users can click
/// to fully expand or collapse.
- #[default]- Automatic,
+ Preview,
/// Thinking blocks are always fully expanded by default (no height constraint).
AlwaysExpanded,
/// Thinking blocks are always collapsed by default.
@@ -7340,7 +7340,7 @@ fn ai_page(cx: &App) -> SettingsPage {
}),
SettingsPageItem::SettingItem(SettingItem {
title: "Thinking Display",
- description: "How thinking blocks should be displayed by default. 'Automatic' auto-expands with a height constraint during streaming. 'Always Expanded' shows full content. 'Always Collapsed' keeps them collapsed.",
+ description: "How thinking blocks should be displayed by default. 'Auto' fully expands during streaming, then auto-collapses when done. 'Preview' auto-expands with a height constraint during streaming. 'Always Expanded' shows full content. 'Always Collapsed' keeps them collapsed.",
field: Box::new(SettingField {
json_path: Some("agent.thinking_display"),
pick: |settings_content| {