Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't show parallel agent announcement if AI is disabled (#54571)

Max Brunsfeld33ebeb985082
diff --git a/Cargo.lock b/Cargo.lock
index 14f14dad109..7270a975b59 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1293,10 +1293,12 @@ dependencies = [
"gpui",
"markdown_preview",
"notifications",
+ "project",
"release_channel",
"semver",
"serde",
"serde_json",
+ "settings",
"smol",
"telemetry",
"ui",
diff --git a/crates/auto_update_ui/Cargo.toml b/crates/auto_update_ui/Cargo.toml
index 16783aa9e96..57daa55394e 100644
--- a/crates/auto_update_ui/Cargo.toml
+++ b/crates/auto_update_ui/Cargo.toml
@@ -17,15 +17,17 @@ anyhow.workspace = true
auto_update.workspace = true
client.workspace = true
db.workspace = true
-fs.workspace = true
editor.workspace = true
-notifications.workspace = true
+fs.workspace = true
gpui.workspace = true
markdown_preview.workspace = true
+notifications.workspace = true
+project.workspace = true
release_channel.workspace = true
semver.workspace = true
serde.workspace = true
serde_json.workspace = true
+settings.workspace = true
smol.workspace = true
telemetry.workspace = true
ui.workspace = true
diff --git a/crates/auto_update_ui/src/auto_update_ui.rs b/crates/auto_update_ui/src/auto_update_ui.rs
index ebd0d2c06dc..77ba83597ed 100644
--- a/crates/auto_update_ui/src/auto_update_ui.rs
+++ b/crates/auto_update_ui/src/auto_update_ui.rs
@@ -13,6 +13,7 @@ use notifications::status_toast::StatusToast;
use release_channel::{AppVersion, ReleaseChannel};
use semver::Version;
use serde::Deserialize;
+use settings::Settings as _;
use smol::io::AsyncReadExt;
use ui::{AnnouncementToast, ListBulletItem, ParallelAgentsIllustration, prelude::*};
use util::{ResultExt as _, maybe};
@@ -204,7 +205,10 @@ fn announcement_for_version(version: &Version, cx: &App) -> Option<AnnouncementC
}
};
- if *version >= version_with_parallel_agents && !ParallelAgentAnnouncement::dismissed(cx) {
+ if *version >= version_with_parallel_agents
+ && !ParallelAgentAnnouncement::dismissed(cx)
+ && !project::DisableAiSettings::get_global(cx).disable_ai
+ {
let fs = <dyn Fs>::global(cx);
Some(AnnouncementContent {
heading: "Introducing Parallel Agents".into(),