Fix hiding editor toolbar and add agent_review setting (#29854)

Closes #29836

The agent diff toolbar item was causing the editor toolbar to show even
when all the other elements were disabled via settings.

This PR fixes this by setting the location to
`ToolbarItemLocation::Hidden` in the states where it shouldn't show.

It also adds a new a `toolbar.agent_review` setting to hide the agent
review buttons altogether. However, if the other toolbar elements are
hidden and the file isn't under review, the editor toolbar will still be
hidden. So you only need to set this to `false` if you don't want them
to show up even under agent review.

Release Notes:

- N/A
This commit is contained in:
Agus Zubiaga 2025-05-03 17:43:46 -03:00 committed by GitHub
parent 1fc57ea9f5
commit 9c11d24887
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 159 additions and 53 deletions

View file

@ -101,6 +101,7 @@ pub struct Toolbar {
pub breadcrumbs: bool,
pub quick_actions: bool,
pub selections_menu: bool,
pub agent_review: bool,
}
#[derive(Copy, Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
@ -400,11 +401,15 @@ pub struct ToolbarContent {
///
/// Default: true
pub quick_actions: Option<bool>,
/// Whether to show the selections menu in the editor toolbar
/// Whether to show the selections menu in the editor toolbar.
///
/// Default: true
pub selections_menu: Option<bool>,
/// Whether to display Agent review buttons in the editor toolbar.
/// Only applicable while reviewing a file edited by the Agent.
///
/// Default: true
pub agent_review: Option<bool>,
}
/// Scrollbar related settings