inline_completion_button: Put "Eager Preview Mode" menu entry behind a feature flag (#24734)
This PR puts the "Eager Preview Mode" menu entry behind a feature flag rather than a staff flag. Currently it defaults to `false` for staff so that it doesn't leak into any marketing/launch materials. Folks who want to see it can opt-in to the flag explicitly, for now. Release Notes: - N/A
This commit is contained in:
parent
51092c4e31
commit
3f95d79fc5
2 changed files with 19 additions and 10 deletions
|
@ -69,6 +69,17 @@ impl FeatureFlag for PredictEditsRateCompletionsFeatureFlag {
|
|||
const NAME: &'static str = "predict-edits-rate-completions";
|
||||
}
|
||||
|
||||
/// A feature flag that controls whether "non eager mode" (holding `alt` to preview) is publicized.
|
||||
pub struct PredictEditsNonEagerModeFeatureFlag;
|
||||
impl FeatureFlag for PredictEditsNonEagerModeFeatureFlag {
|
||||
const NAME: &'static str = "predict-edits-non-eager-mode";
|
||||
|
||||
fn enabled_for_staff() -> bool {
|
||||
// Don't show to staff so it doesn't leak into media for the launch.
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub struct GitUiFeatureFlag;
|
||||
impl FeatureFlag for GitUiFeatureFlag {
|
||||
const NAME: &'static str = "git-ui";
|
||||
|
|
|
@ -569,12 +569,12 @@ impl InlineCompletionButton {
|
|||
);
|
||||
}
|
||||
|
||||
let is_eager_preview_enabled = match settings.edit_predictions_mode() {
|
||||
language::EditPredictionsMode::Auto => false,
|
||||
language::EditPredictionsMode::EagerPreview => true,
|
||||
};
|
||||
menu = if cx.is_staff() {
|
||||
menu.separator().toggleable_entry(
|
||||
if cx.has_flag::<feature_flags::PredictEditsNonEagerModeFeatureFlag>() {
|
||||
let is_eager_preview_enabled = match settings.edit_predictions_mode() {
|
||||
language::EditPredictionsMode::Auto => false,
|
||||
language::EditPredictionsMode::EagerPreview => true,
|
||||
};
|
||||
menu = menu.separator().toggleable_entry(
|
||||
"Eager Preview Mode",
|
||||
is_eager_preview_enabled,
|
||||
IconPosition::Start,
|
||||
|
@ -604,10 +604,8 @@ impl InlineCompletionButton {
|
|||
);
|
||||
}
|
||||
},
|
||||
)
|
||||
} else {
|
||||
menu
|
||||
};
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(editor_focus_handle) = self.editor_focus_handle.clone() {
|
||||
menu = menu
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue