agent: Make assistant panel input size configurable (#37975)

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.

<img width="800" height="1316" alt="Screenshot 2025-09-11 at 5 47 18 pm"
src="https://github.com/user-attachments/assets/20990b90-c4f9-4f5c-af59-76358642a273"
/>

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
This commit is contained in:
Owen Kelly
2025-09-16 00:27:25 +00:00
committed by GitHub
co-authored by Danilo Leal
parent ceb907e0dc
commit 6446963a0c
4 changed files with 38 additions and 8 deletions
+5 -1
View File
@@ -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": {
@@ -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<bool>,
/// Minimum number of lines of height the agent message editor should have.
///
/// Default: 4
message_editor_min_lines: Option<usize>,
}
#[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
+5 -7
View File
@@ -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,
)
+15
View File
@@ -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.