Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
settings_ui: Make agent settings searchable (#60151)
Bennet Bo Fenner56562c28b0eb
diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rsindex 5434016c50c..4d1101d7186 100644--- a/crates/settings_ui/src/page_data.rs+++ b/crates/settings_ui/src/page_data.rs@@ -94,6 +94,7 @@ fn developer_page(cx: &App) -> SettingsPage {title: "Feature Flags".into(),r#type: Default::default(),description: None,+ search_aliases: &[],json_path: Some("feature_flags"),in_json: true,files: USER,@@ -3376,6 +3377,7 @@ fn languages_and_tools_page(cx: &App) -> SettingsPage {title: language_name,r#type: crate::SubPageType::Language,description: None,+ search_aliases: &[],json_path: Some(link.leak()),in_json: true,files: USER | PROJECT,@@ -7990,6 +7992,32 @@ fn ai_page(cx: &App) -> SettingsPage {r#type: Default::default(),json_path: Some("llm_providers"),description: Some("Configure API keys and settings for LLM providers.".into()),+ search_aliases: &[+ "ai",+ "amazon",+ "anthropic",+ "api key",+ "azure",+ "bedrock",+ "chat",+ "claude",+ "copilot",+ "gemini",+ "github",+ "google",+ "gpt",+ "grok",+ "llama",+ "llm",+ "lm studio",+ "mistral",+ "ollama",+ "openai",+ "opencode",+ "provider",+ "vercel",+ "xai",+ ],in_json: false,files: USER,render: render_llm_providers_page,@@ -8002,6 +8030,7 @@ fn ai_page(cx: &App) -> SettingsPage {r#type: Default::default(),json_path: Some(zed_actions::AGENT_SKILLS_SETTINGS_PATH),description: Some("View and manage agent skills installed globally or in project worktrees.".into()),+ search_aliases: &["agent skill", "agent skills", "custom instructions", "skill", "skills"],in_json: false,files: USER | PROJECT,render: render_skills_setup_page,@@ -8014,6 +8043,15 @@ fn ai_page(cx: &App) -> SettingsPage {"Review and change the elevated terminal sandbox permissions that are always allowed without prompting.".into(),),+ search_aliases: &[+ "allow",+ "domain",+ "filesystem",+ "network",+ "sandbox",+ "unsandboxed",+ "permissions",+ ],in_json: true,files: USER,render: render_sandbox_settings_page,@@ -8023,6 +8061,7 @@ fn ai_page(cx: &App) -> SettingsPage {r#type: Default::default(),json_path: Some("agent.tool_permissions"),description: Some("Set up regex patterns to auto-allow, auto-deny, or always request confirmation, for specific tool inputs.".into()),+ search_aliases: &[],in_json: true,files: USER,render: render_tool_permissions_setup_page,@@ -8037,6 +8076,7 @@ fn ai_page(cx: &App) -> SettingsPage {description: Some("View, add, configure, and remove Model Context Protocol servers.".into(),),+ search_aliases: &["context server", "mcp", "model context protocol"],in_json: false,files: USER,render: render_mcp_servers_page,@@ -8049,6 +8089,22 @@ fn ai_page(cx: &App) -> SettingsPage {"View, add, and remove agents connected through the Agent Client Protocol.".into(),),+ search_aliases: &[+ "acp",+ "agent client protocol",+ "amp",+ "claude agent",+ "claude code",+ "codex",+ "copilot cli",+ "cursor",+ "external agent",+ "factory droid",+ "github copilot",+ "grok build",+ "junie",+ "opencode",+ ],in_json: false,files: USER,render: render_external_agents_page,@@ -10374,6 +10430,7 @@ fn edit_prediction_language_settings_section() -> [SettingsPageItem; 5] {r#type: Default::default(),json_path: Some("edit_predictions.providers"),description: Some("Set up different edit prediction providers in complement to Zed's built-in Zeta model.".into()),+ search_aliases: &[],in_json: false,files: USER,render: render_edit_prediction_setup_pagediff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rsindex 4847d066bae..991789eb5a7 100644--- a/crates/settings_ui/src/settings_ui.rs+++ b/crates/settings_ui/src/settings_ui.rs@@ -1585,6 +1585,7 @@ struct SubPageLink {title: SharedString,r#type: SubPageType,description: Option<SharedString>,+ search_aliases: &'static [&'static str],/// See [`SettingField.json_path`]json_path: Option<&'static str>,/// Whether or not the settings in this sub page are configurable in settings.json@@ -2351,19 +2352,20 @@ impl SettingsWindow {}SettingsPageItem::SubPageLink(sub_page_link) => {json_path = sub_page_link.json_path;+ let mut parts = vec![page.title, header_str, sub_page_link.title.as_ref()];+ parts.extend(sub_page_link.search_aliases);documents.push(SearchDocument {id: key_index,- words: split_into_words(&[- page.title,- header_str,- sub_page_link.title.as_ref(),- ]),+ words: split_into_words(&parts),});push_candidates(&mut fuzzy_match_candidates,key_index,sub_page_link.title.as_ref(),);+ for alias in sub_page_link.search_aliases {+ push_candidates(&mut fuzzy_match_candidates, key_index, alias);+ }}SettingsPageItem::ActionLink(action_link) => {documents.push(SearchDocument {@@ -4128,6 +4130,7 @@ impl SettingsWindow {title: title.into(),r#type: SubPageType::default(),description: None,+ search_aliases: &[],json_path,in_json,files: USER,@@ -4185,6 +4188,7 @@ impl SettingsWindow {title: "Create Skill".into(),r#type: SubPageType::SkillCreator,description: None,+ search_aliases: &[],json_path: None,in_json: false,files: USER | PROJECT,