Put zed: open account settings
action behind a feature flag (#17014)
This PR puts the `zed: open account settings` action behind the `zed-pro` feature flag, as it isn't supposed to be visible to users yet. Closes https://github.com/zed-industries/zed/issues/17010. Release Notes: - N/A
This commit is contained in:
parent
324964d23a
commit
c988ff8ed7
3 changed files with 31 additions and 1 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -14110,6 +14110,7 @@ dependencies = [
|
||||||
"collab_ui",
|
"collab_ui",
|
||||||
"collections",
|
"collections",
|
||||||
"command_palette",
|
"command_palette",
|
||||||
|
"command_palette_hooks",
|
||||||
"copilot",
|
"copilot",
|
||||||
"db",
|
"db",
|
||||||
"dev_server_projects",
|
"dev_server_projects",
|
||||||
|
@ -14118,6 +14119,7 @@ dependencies = [
|
||||||
"env_logger",
|
"env_logger",
|
||||||
"extension",
|
"extension",
|
||||||
"extensions_ui",
|
"extensions_ui",
|
||||||
|
"feature_flags",
|
||||||
"feedback",
|
"feedback",
|
||||||
"file_finder",
|
"file_finder",
|
||||||
"file_icons",
|
"file_icons",
|
||||||
|
|
|
@ -32,6 +32,7 @@ client.workspace = true
|
||||||
collab_ui.workspace = true
|
collab_ui.workspace = true
|
||||||
collections.workspace = true
|
collections.workspace = true
|
||||||
command_palette.workspace = true
|
command_palette.workspace = true
|
||||||
|
command_palette_hooks.workspace = true
|
||||||
copilot.workspace = true
|
copilot.workspace = true
|
||||||
db.workspace = true
|
db.workspace = true
|
||||||
diagnostics.workspace = true
|
diagnostics.workspace = true
|
||||||
|
@ -39,9 +40,10 @@ editor.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
extension.workspace = true
|
extension.workspace = true
|
||||||
extensions_ui.workspace = true
|
extensions_ui.workspace = true
|
||||||
|
feature_flags.workspace = true
|
||||||
feedback.workspace = true
|
feedback.workspace = true
|
||||||
file_icons.workspace = true
|
|
||||||
file_finder.workspace = true
|
file_finder.workspace = true
|
||||||
|
file_icons.workspace = true
|
||||||
fs.workspace = true
|
fs.workspace = true
|
||||||
futures.workspace = true
|
futures.workspace = true
|
||||||
git.workspace = true
|
git.workspace = true
|
||||||
|
|
|
@ -11,7 +11,9 @@ use assistant::PromptBuilder;
|
||||||
use breadcrumbs::Breadcrumbs;
|
use breadcrumbs::Breadcrumbs;
|
||||||
use client::ZED_URL_SCHEME;
|
use client::ZED_URL_SCHEME;
|
||||||
use collections::VecDeque;
|
use collections::VecDeque;
|
||||||
|
use command_palette_hooks::CommandPaletteFilter;
|
||||||
use editor::{scroll::Autoscroll, Editor, MultiBuffer};
|
use editor::{scroll::Autoscroll, Editor, MultiBuffer};
|
||||||
|
use feature_flags::FeatureFlagAppExt;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, point, px, AppContext, AsyncAppContext, Context, FocusableView, MenuItem, PromptLevel,
|
actions, point, px, AppContext, AsyncAppContext, Context, FocusableView, MenuItem, PromptLevel,
|
||||||
ReadGlobal, TitlebarOptions, View, ViewContext, VisualContext, WindowKind, WindowOptions,
|
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,
|
initial_local_settings_content, initial_tasks_content, watch_config_file, KeymapFile, Settings,
|
||||||
SettingsStore, DEFAULT_KEYMAP_PATH,
|
SettingsStore, DEFAULT_KEYMAP_PATH,
|
||||||
};
|
};
|
||||||
|
use std::any::TypeId;
|
||||||
use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc};
|
use std::{borrow::Cow, ops::Deref, path::Path, sync::Arc};
|
||||||
use task::static_source::{StaticSource, TrackedFile};
|
use task::static_source::{StaticSource, TrackedFile};
|
||||||
use theme::ActiveTheme;
|
use theme::ActiveTheme;
|
||||||
|
@ -541,6 +544,29 @@ pub fn initialize_workspace(
|
||||||
workspace.focus_handle(cx).focus(cx);
|
workspace.focus_handle(cx).focus(cx);
|
||||||
})
|
})
|
||||||
.detach();
|
.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>) {
|
fn initialize_pane(workspace: &mut Workspace, pane: &View<Pane>, cx: &mut ViewContext<Workspace>) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue