From 6446963a0ca93f3d311db261a457c7d3879cafa5 Mon Sep 17 00:00:00 2001 From: Owen Kelly Date: Tue, 16 Sep 2025 10:27:25 +1000 Subject: [PATCH] agent: Make assistant panel input size configurable (#37975) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Release Notes: - Added the `agent. message_editor_min_lines `setting to allow users to customize the agent panel message editor default size by using a different minimum number of lines. Screenshot 2025-09-11 at 5 47 18 pm --------- Co-authored-by: Danilo Leal --- assets/settings/default.json | 6 +++++- crates/agent_settings/src/agent_settings.rs | 13 +++++++++++++ crates/agent_ui/src/acp/thread_view.rs | 12 +++++------- docs/src/ai/agent-settings.md | 15 +++++++++++++++ 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/assets/settings/default.json b/assets/settings/default.json index 5dcb418184f592e941d23763f7fe39898413cb79..daab56dc93976728667ed6995cb445f363ee2be8 100644 --- a/assets/settings/default.json +++ b/assets/settings/default.json @@ -914,7 +914,11 @@ /// Whether to have terminal cards in the agent panel expanded, showing the whole command output. /// /// Default: true - "expand_terminal_card": true + "expand_terminal_card": true, + // Minimum number of lines to display in the agent message editor. + // + // Default: 4 + "message_editor_min_lines": 4 }, // The settings for slash commands. "slash_commands": { diff --git a/crates/agent_settings/src/agent_settings.rs b/crates/agent_settings/src/agent_settings.rs index e850945a40f46f31543fad2631216139706b405a..153b64a3950718c3a8e8770a362b7c43a9bf443f 100644 --- a/crates/agent_settings/src/agent_settings.rs +++ b/crates/agent_settings/src/agent_settings.rs @@ -75,6 +75,7 @@ pub struct AgentSettings { pub expand_edit_card: bool, pub expand_terminal_card: bool, pub use_modifier_to_send: bool, + pub message_editor_min_lines: usize, } impl AgentSettings { @@ -107,6 +108,10 @@ impl AgentSettings { model, }); } + + pub fn set_message_editor_max_lines(&self) -> usize { + self.message_editor_min_lines * 2 + } } #[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq)] @@ -320,6 +325,10 @@ pub struct AgentSettingsContent { /// /// Default: false use_modifier_to_send: Option, + /// Minimum number of lines of height the agent message editor should have. + /// + /// Default: 4 + message_editor_min_lines: Option, } #[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Default)] @@ -472,6 +481,10 @@ impl Settings for AgentSettings { &mut settings.use_modifier_to_send, value.use_modifier_to_send, ); + merge( + &mut settings.message_editor_min_lines, + value.message_editor_min_lines, + ); settings .model_parameters diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index ceed3f8f98fbf95f5b4278d8354e30e90299b18d..73b1fee3caa60ce14bceef7245470c0ec0c02a3d 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -71,9 +71,6 @@ use crate::{ RejectOnce, ToggleBurnMode, ToggleProfileSelector, }; -pub const MIN_EDITOR_LINES: usize = 4; -pub const MAX_EDITOR_LINES: usize = 8; - #[derive(Copy, Clone, Debug, PartialEq, Eq)] enum ThreadFeedback { Positive, @@ -357,8 +354,8 @@ impl AcpThreadView { agent.name(), &placeholder, editor::EditorMode::AutoHeight { - min_lines: MIN_EDITOR_LINES, - max_lines: Some(MAX_EDITOR_LINES), + min_lines: AgentSettings::get_global(cx).message_editor_min_lines, + max_lines: Some(AgentSettings::get_global(cx).set_message_editor_max_lines()), }, window, cx, @@ -857,10 +854,11 @@ impl AcpThreadView { cx, ) } else { + let agent_settings = AgentSettings::get_global(cx); editor.set_mode( EditorMode::AutoHeight { - min_lines: MIN_EDITOR_LINES, - max_lines: Some(MAX_EDITOR_LINES), + min_lines: agent_settings.message_editor_min_lines, + max_lines: Some(agent_settings.set_message_editor_max_lines()), }, cx, ) diff --git a/docs/src/ai/agent-settings.md b/docs/src/ai/agent-settings.md index d78f812e4704123be34144e84709df71474c82c0..d13e7733878339165293a250d1d5f253ef799e5d 100644 --- a/docs/src/ai/agent-settings.md +++ b/docs/src/ai/agent-settings.md @@ -170,6 +170,21 @@ The default value is `false`. > This setting is available via the Agent Panel's settings UI. +### Message Editor Size + +Use the `message_editor_min_lines` setting to control minimum number of lines of height the agent message editor should have. +It is set to `4` by default, and the max number of lines is always double of the minimum. + +```json +{ + "agent": { + "message_editor_min_lines": 4 + } +} +``` + +> This setting is currently available only in Preview. + ### Modifier to Send Make a modifier (`cmd` on macOS, `ctrl` on Linux) required to send messages.