Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Put `zed: open account settings` action behind a feature flag (#17014)
Marshall Bowersc988ff8ed7ef
diff --git a/Cargo.lock b/Cargo.lockindex 4ddc3966191..a15c497ba67 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -14110,6 +14110,7 @@ dependencies = ["collab_ui","collections","command_palette",+ "command_palette_hooks","copilot","db","dev_server_projects",@@ -14118,6 +14119,7 @@ dependencies = ["env_logger","extension","extensions_ui",+ "feature_flags","feedback","file_finder","file_icons",diff --git a/crates/zed/Cargo.toml b/crates/zed/Cargo.tomlindex 2afa407c8b6..c4647593e9e 100644--- a/crates/zed/Cargo.toml+++ b/crates/zed/Cargo.toml@@ -32,6 +32,7 @@ client.workspace = truecollab_ui.workspace = truecollections.workspace = truecommand_palette.workspace = true+command_palette_hooks.workspace = truecopilot.workspace = truedb.workspace = truediagnostics.workspace = true@@ -39,9 +40,10 @@ editor.workspace = trueenv_logger.workspace = trueextension.workspace = trueextensions_ui.workspace = true+feature_flags.workspace = truefeedback.workspace = true-file_icons.workspace = truefile_finder.workspace = true+file_icons.workspace = truefs.workspace = truefutures.workspace = truegit.workspace = truediff --git a/crates/zed/src/zed.rs b/crates/zed/src/zed.rsindex 300510c8bed..1b9b8ee042a 100644--- a/crates/zed/src/zed.rs+++ b/crates/zed/src/zed.rs@@ -11,7 +11,9 @@ use assistant::PromptBuilder;use breadcrumbs::Breadcrumbs;use client::ZED_URL_SCHEME;use collections::VecDeque;+use command_palette_hooks::CommandPaletteFilter;use editor::{scroll::Autoscroll, Editor, MultiBuffer};+use feature_flags::FeatureFlagAppExt;use gpui::{actions, point, px, AppContext, AsyncAppContext, Context, FocusableView, MenuItem, PromptLevel,ReadGlobal, TitlebarOptions, View, ViewContext, VisualContext, WindowKind, WindowOptions,@@ -32,6 +34,7 @@ use settings::{initial_local_settings_content, initial_tasks_content, watch_config_file, KeymapFile, Settings,SettingsStore, DEFAULT_KEYMAP_PATH,};+use std::any::TypeId;use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc};use task::static_source::{StaticSource, TrackedFile};use theme::ActiveTheme;@@ -541,6 +544,29 @@ pub fn initialize_workspace(workspace.focus_handle(cx).focus(cx);}).detach();++ feature_gate_zed_pro_actions(cx);+}++fn feature_gate_zed_pro_actions(cx: &mut AppContext) {+ let zed_pro_actions = [TypeId::of::<OpenAccountSettings>()];++ CommandPaletteFilter::update_global(cx, |filter, _cx| {+ filter.hide_action_types(&zed_pro_actions);+ });++ cx.observe_flag::<feature_flags::ZedPro, _>({+ move |is_enabled, cx| {+ CommandPaletteFilter::update_global(cx, |filter, _cx| {+ if is_enabled {+ filter.show_action_types(zed_pro_actions.iter());+ } else {+ filter.hide_action_types(&zed_pro_actions);+ }+ });+ }+ })+ .detach();}fn initialize_pane(workspace: &mut Workspace, pane: &View<Pane>, cx: &mut ViewContext<Workspace>) {