agent: Add setting to control edit card expanded state (#34040)
This PR adds the `expand_edit_card` setting, which controls whether edit cards in the agent panel are expanded, thus showing or not the full diff of a given file's AI-driven change. I personally prefer to have these cards collapsed by default as I am mostly reviewing diffs using either the review multibuffer or the diffs within the file's buffer itself. Didn't want to change the default behavior as that was intentionally chosen, so here we are! :) Open to feedback about the setting name; I've iterated between a few options and don't necessarily feel like the current one is the best. Release Notes: - agent: Added a setting to control whether edit cards are expanded in the agent panel, thus showing or hiding the full diff of a file's changes.
This commit is contained in:
@@ -67,6 +67,7 @@ pub struct AgentSettings {
|
||||
pub model_parameters: Vec<LanguageModelParameters>,
|
||||
pub preferred_completion_mode: CompletionMode,
|
||||
pub enable_feedback: bool,
|
||||
pub expand_edit_card: bool,
|
||||
}
|
||||
|
||||
impl AgentSettings {
|
||||
@@ -291,6 +292,10 @@ pub struct AgentSettingsContent {
|
||||
///
|
||||
/// Default: true
|
||||
enable_feedback: Option<bool>,
|
||||
/// Whether to have edit cards in the agent panel expanded, showing a preview of the full diff.
|
||||
///
|
||||
/// Default: true
|
||||
expand_edit_card: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Default)]
|
||||
@@ -441,6 +446,7 @@ impl Settings for AgentSettings {
|
||||
value.preferred_completion_mode,
|
||||
);
|
||||
merge(&mut settings.enable_feedback, value.enable_feedback);
|
||||
merge(&mut settings.expand_edit_card, value.expand_edit_card);
|
||||
|
||||
settings
|
||||
.model_parameters
|
||||
|
||||
Reference in New Issue
Block a user