agent_ui: Improve menu items related to rules (#57828)

Also adds a menu item called "Rules Library" that takes to the
documentation, which will explain the removal of the feature as a whole.

Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
Danilo LealandBennet Bo Fenner authored and GitHub committed 2026-05-27 14:03:28 +00:00
1 parent d2cbf930f7
commit ceff1b227b
2 files changed
+36 -7

No files matched your search

+32 -7
View File
@@ -57,7 +57,7 @@ use anyhow::Result;
#[cfg(feature = "audio")]
use audio::{Audio, Sound};
use chrono::{DateTime, Utc};
use client::UserStore;
use client::{UserStore, zed_urls};
use cloud_api_types::Plan;
use collections::HashMap;
use editor::{Editor, MultiBuffer};
@@ -4958,9 +4958,20 @@ impl AgentPanel {
if global_agents_md_loaded {
let workspace = workspace.clone();
menu = menu.entry(
"Open Global AGENTS.md",
None,
menu = menu.custom_entry(
|_window, _cx| {
h_flex()
.w_full()
.gap_1()
.child(Label::new("Open Global Rules"))
.child(
Label::new("(AGENTS.md)")
.color(Color::Muted)
.size(LabelSize::Small),
)
.into_any_element()
},
move |window, cx| {
workspace
.update(cx, |workspace, cx| {
@@ -4983,9 +4994,19 @@ impl AgentPanel {
if let Some(path) = project_agents_md_path.clone() {
let workspace = workspace.clone();
menu = menu.entry(
"Open Project AGENTS.md",
None,
menu = menu.custom_entry(
|_window, _cx| {
h_flex()
.w_full()
.gap_1()
.child(Label::new("Open Project Rules"))
.child(
Label::new("(AGENTS.md)")
.color(Color::Muted)
.size(LabelSize::Small),
)
.into_any_element()
},
move |window, cx| {
let path = path.clone();
workspace
@@ -5007,6 +5028,10 @@ impl AgentPanel {
);
}
menu = menu.entry("Rules Library", None, |_window, cx| {
cx.open_url(&zed_urls::rules_docs(cx));
});
menu = menu.separator();
}
+4
View File
@@ -56,6 +56,10 @@ pub fn skills_docs(cx: &App) -> String {
format!("{server_url}/docs/ai/skills", server_url = server_url(cx))
}
pub fn rules_docs(cx: &App) -> String {
format!("{server_url}/docs/ai/rules", server_url = server_url(cx))
}
/// Returns the URL to Zed's ACP registry blog post.
pub fn acp_registry_blog(cx: &App) -> String {
format!(