Update assistant to agent in settings and keymaps (#29943)

Closes #ISSUE

Release Notes:

- Agent Beta: Renamed the top-level `assistant` settings key to `agent`.
A migration for existing settings files is included.
- Agent Beta: Moved the `assistant::ToggleFocus`,
`assistant::ToggleModelSelector`, and `assistant::OpenRulesLibrary`
actions to the `agent` namespace. Existing keymaps that mention these
actions by their old names will continue to work.

---------

Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Cole Miller 2025-05-05 21:02:56 -04:00 committed by GitHub
parent 34e10e4e56
commit bdd911f89e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 191 additions and 58 deletions

View file

@ -693,7 +693,7 @@ pub struct LegacyAssistantSettingsContent {
}
impl Settings for AssistantSettings {
const KEY: Option<&'static str> = Some("assistant");
const KEY: Option<&'static str> = Some("agent");
const PRESERVED_KEYS: Option<&'static [&'static str]> = Some(&["version"]);
@ -894,12 +894,12 @@ mod tests {
#[derive(Debug, Deserialize)]
struct AssistantSettingsTest {
assistant: AssistantSettingsContent,
agent: AssistantSettingsContent,
}
let assistant_settings: AssistantSettingsTest =
serde_json_lenient::from_str(&raw_settings_value).unwrap();
assert!(!assistant_settings.assistant.is_version_outdated());
assert!(!assistant_settings.agent.is_version_outdated());
}
}