Add TestPanic feature flag (#34963)

Now the `dev: panic` action can be run on all release channels if the
user has the feature flag enabled.

Release Notes:

- N/A
This commit is contained in:
Julia Ryan 2025-07-23 13:01:16 -05:00 committed by GitHub
parent 56b64b1d3f
commit 5f0edd38f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 11 deletions

1
Cargo.lock generated
View file

@ -20211,6 +20211,7 @@ dependencies = [
"extension", "extension",
"extension_host", "extension_host",
"extensions_ui", "extensions_ui",
"feature_flags",
"feedback", "feedback",
"file_finder", "file_finder",
"fs", "fs",

View file

@ -85,6 +85,11 @@ impl FeatureFlag for ThreadAutoCaptureFeatureFlag {
false false
} }
} }
pub struct PanicFeatureFlag;
impl FeatureFlag for PanicFeatureFlag {
const NAME: &'static str = "panic";
}
pub struct JjUiFeatureFlag {} pub struct JjUiFeatureFlag {}

View file

@ -56,6 +56,7 @@ env_logger.workspace = true
extension.workspace = true extension.workspace = true
extension_host.workspace = true extension_host.workspace = true
extensions_ui.workspace = true extensions_ui.workspace = true
feature_flags.workspace = true
feedback.workspace = true feedback.workspace = true
file_finder.workspace = true file_finder.workspace = true
fs.workspace = true fs.workspace = true

View file

@ -19,6 +19,7 @@ use collections::VecDeque;
use debugger_ui::debugger_panel::DebugPanel; use debugger_ui::debugger_panel::DebugPanel;
use editor::ProposedChangesEditorToolbar; use editor::ProposedChangesEditorToolbar;
use editor::{Editor, MultiBuffer}; use editor::{Editor, MultiBuffer};
use feature_flags::{FeatureFlagAppExt, PanicFeatureFlag};
use futures::future::Either; use futures::future::Either;
use futures::{StreamExt, channel::mpsc, select_biased}; use futures::{StreamExt, channel::mpsc, select_biased};
use git_ui::git_panel::GitPanel; use git_ui::git_panel::GitPanel;
@ -53,9 +54,12 @@ use settings::{
initial_local_debug_tasks_content, initial_project_settings_content, initial_tasks_content, initial_local_debug_tasks_content, initial_project_settings_content, initial_tasks_content,
update_settings_file, update_settings_file,
}; };
use std::path::PathBuf; use std::{
use std::sync::atomic::{self, AtomicBool}; borrow::Cow,
use std::{borrow::Cow, path::Path, sync::Arc}; path::{Path, PathBuf},
sync::Arc,
sync::atomic::{self, AtomicBool},
};
use terminal_view::terminal_panel::{self, TerminalPanel}; use terminal_view::terminal_panel::{self, TerminalPanel};
use theme::{ActiveTheme, ThemeSettings}; use theme::{ActiveTheme, ThemeSettings};
use ui::{PopoverMenuHandle, prelude::*}; use ui::{PopoverMenuHandle, prelude::*};
@ -120,11 +124,9 @@ pub fn init(cx: &mut App) {
cx.on_action(quit); cx.on_action(quit);
cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx)); cx.on_action(|_: &RestoreBanner, cx| title_bar::restore_banner(cx));
if ReleaseChannel::global(cx) == ReleaseChannel::Dev || cx.has_flag::<PanicFeatureFlag>() {
if ReleaseChannel::global(cx) == ReleaseChannel::Dev { cx.on_action(|_: &TestPanic, _| panic!("Ran the TestPanic action"));
cx.on_action(test_panic);
} }
cx.on_action(|_: &OpenLog, cx| { cx.on_action(|_: &OpenLog, cx| {
with_active_or_new_workspace(cx, |workspace, window, cx| { with_active_or_new_workspace(cx, |workspace, window, cx| {
open_log_file(workspace, window, cx); open_log_file(workspace, window, cx);
@ -987,10 +989,6 @@ fn about(
.detach(); .detach();
} }
fn test_panic(_: &TestPanic, _: &mut App) {
panic!("Ran the TestPanic action")
}
fn install_cli( fn install_cli(
_: &mut Workspace, _: &mut Workspace,
_: &install_cli::Install, _: &install_cli::Install,