From b12d862236d9872a31868746c4ed7423535137d6 Mon Sep 17 00:00:00 2001 From: Agus Zubiaga Date: Tue, 19 Aug 2025 23:11:17 -0300 Subject: [PATCH] Rename acp flag (#36541) Release Notes: - N/A --- crates/agent_ui/src/agent_panel.rs | 18 +++++++++--------- crates/feature_flags/src/feature_flags.rs | 11 ++++++++--- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/crates/agent_ui/src/agent_panel.rs b/crates/agent_ui/src/agent_panel.rs index 93e9f619af..297bb5f3e8 100644 --- a/crates/agent_ui/src/agent_panel.rs +++ b/crates/agent_ui/src/agent_panel.rs @@ -45,7 +45,7 @@ use assistant_tool::ToolWorkingSet; use client::{UserStore, zed_urls}; use cloud_llm_client::{CompletionIntent, Plan, UsageLimit}; use editor::{Anchor, AnchorRangeExt as _, Editor, EditorEvent, MultiBuffer}; -use feature_flags::{self, AcpFeatureFlag, ClaudeCodeFeatureFlag, FeatureFlagAppExt}; +use feature_flags::{self, ClaudeCodeFeatureFlag, FeatureFlagAppExt, GeminiAndNativeFeatureFlag}; use fs::Fs; use gpui::{ Action, Animation, AnimationExt as _, AnyElement, App, AsyncWindowContext, ClipboardItem, @@ -725,7 +725,7 @@ impl AgentPanel { let assistant_navigation_menu = ContextMenu::build_persistent(window, cx, move |mut menu, _window, cx| { if let Some(panel) = panel.upgrade() { - if cx.has_flag::() { + if cx.has_flag::() { menu = Self::populate_recently_opened_menu_section_new(menu, panel, cx); } else { menu = Self::populate_recently_opened_menu_section_old(menu, panel, cx); @@ -881,7 +881,7 @@ impl AgentPanel { } fn new_thread(&mut self, action: &NewThread, window: &mut Window, cx: &mut Context) { - if cx.has_flag::() { + if cx.has_flag::() { return self.new_agent_thread(AgentType::NativeAgent, window, cx); } // Preserve chat box text when using creating new thread @@ -1058,7 +1058,7 @@ impl AgentPanel { this.update_in(cx, |this, window, cx| { match ext_agent { crate::ExternalAgent::Gemini | crate::ExternalAgent::NativeAgent => { - if !cx.has_flag::() { + if !cx.has_flag::() { return; } } @@ -1825,7 +1825,7 @@ impl Focusable for AgentPanel { ActiveView::Thread { message_editor, .. } => message_editor.focus_handle(cx), ActiveView::ExternalAgentThread { thread_view, .. } => thread_view.focus_handle(cx), ActiveView::History => { - if cx.has_flag::() { + if cx.has_flag::() { self.acp_history.focus_handle(cx) } else { self.history.focus_handle(cx) @@ -2441,7 +2441,7 @@ impl AgentPanel { ) .separator() .header("External Agents") - .when(cx.has_flag::(), |menu| { + .when(cx.has_flag::(), |menu| { menu.item( ContextMenuEntry::new("New Gemini Thread") .icon(IconName::AiGemini) @@ -2564,7 +2564,7 @@ impl AgentPanel { } fn render_toolbar(&self, window: &mut Window, cx: &mut Context) -> impl IntoElement { - if cx.has_flag::() + if cx.has_flag::() || cx.has_flag::() { self.render_toolbar_new(window, cx).into_any_element() @@ -2749,7 +2749,7 @@ impl AgentPanel { false } _ => { - let history_is_empty = if cx.has_flag::() { + let history_is_empty = if cx.has_flag::() { self.acp_history_store.read(cx).is_empty(cx) } else { self.history_store @@ -3641,7 +3641,7 @@ impl Render for AgentPanel { .child(thread_view.clone()) .child(self.render_drag_target(cx)), ActiveView::History => { - if cx.has_flag::() { + if cx.has_flag::() { parent.child(self.acp_history.clone()) } else { parent.child(self.history.clone()) diff --git a/crates/feature_flags/src/feature_flags.rs b/crates/feature_flags/src/feature_flags.rs index 49ccfcc85c..422979c429 100644 --- a/crates/feature_flags/src/feature_flags.rs +++ b/crates/feature_flags/src/feature_flags.rs @@ -89,10 +89,15 @@ impl FeatureFlag for JjUiFeatureFlag { const NAME: &'static str = "jj-ui"; } -pub struct AcpFeatureFlag; +pub struct GeminiAndNativeFeatureFlag; -impl FeatureFlag for AcpFeatureFlag { - const NAME: &'static str = "acp"; +impl FeatureFlag for GeminiAndNativeFeatureFlag { + // This was previously called "acp". + // + // We renamed it because existing builds used it to enable the Claude Code + // integration too, and we'd like to turn Gemini/Native on in new builds + // without enabling Claude Code in old builds. + const NAME: &'static str = "gemini-and-native"; } pub struct ClaudeCodeFeatureFlag;