From f865da28a1e7dbae119b5b5b964786d36c9c9d39 Mon Sep 17 00:00:00 2001 From: Antoine Beyeler Date: Wed, 9 Oct 2024 17:37:50 +0200 Subject: [PATCH] Remove the feature flag for the dataframe view --- crates/viewer/re_viewer/src/app.rs | 46 +++++-------------- crates/viewer/re_viewer/src/ui/rerun_menu.rs | 26 ++--------- .../re_viewer_context/src/app_options.rs | 5 -- .../re_viewer_context/src/command_sender.rs | 3 -- .../re_viewer_context/src/test_context.rs | 3 +- 5 files changed, 16 insertions(+), 67 deletions(-) diff --git a/crates/viewer/re_viewer/src/app.rs b/crates/viewer/re_viewer/src/app.rs index b92eaaf0ee07..465ec6b4e760 100644 --- a/crates/viewer/re_viewer/src/app.rs +++ b/crates/viewer/re_viewer/src/app.rs @@ -257,12 +257,11 @@ impl App { } let mut space_view_class_registry = SpaceViewClassRegistry::default(); - if let Err(err) = populate_space_view_class_registry_with_builtin( - &mut space_view_class_registry, - state.app_options(), - ) { + if let Err(err) = + populate_space_view_class_registry_with_builtin(&mut space_view_class_registry) + { re_log::error!( - "Failed to populate space view type registry with built-in space views: {}", + "Failed to populate the view type registry with built-in space views: {}", err ); } @@ -289,15 +288,12 @@ impl App { let panel_state_overrides = startup_options.panel_state_overrides; - let reflection = match crate::reflection::generate_reflection() { - Ok(reflection) => reflection, - Err(err) => { - re_log::error!( - "Failed to create list of serialized default values for components: {err}" - ); - Default::default() - } - }; + let reflection = crate::reflection::generate_reflection().unwrap_or_else(|err| { + re_log::error!( + "Failed to create list of serialized default values for components: {err}" + ); + Default::default() + }); Self { build_info, @@ -537,22 +533,6 @@ impl App { SystemCommand::EnableInspectBlueprintTimeline(show) => { self.app_options_mut().inspect_blueprint_timeline = show; } - SystemCommand::EnableExperimentalDataframeSpaceView(enabled) => { - let result = if enabled { - self.space_view_class_registry - .add_class::() - } else { - self.space_view_class_registry - .remove_class::() - }; - - if let Err(err) = result { - re_log::warn_once!( - "Failed to {} experimental dataframe space view: {err}", - if enabled { "enable" } else { "disable" } - ); - } - } SystemCommand::SetSelection(item) => { self.state.selection_state.set_selection(item); @@ -1724,7 +1704,6 @@ impl eframe::App for App { /// Add built-in space views to the registry. fn populate_space_view_class_registry_with_builtin( space_view_class_registry: &mut SpaceViewClassRegistry, - app_options: &AppOptions, ) -> Result<(), SpaceViewClassRegistryError> { re_tracing::profile_function!(); space_view_class_registry.add_class::()?; @@ -1734,10 +1713,7 @@ fn populate_space_view_class_registry_with_builtin( space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; space_view_class_registry.add_class::()?; - - if app_options.experimental_dataframe_space_view { - space_view_class_registry.add_class::()?; - } + space_view_class_registry.add_class::()?; Ok(()) } diff --git a/crates/viewer/re_viewer/src/ui/rerun_menu.rs b/crates/viewer/re_viewer/src/ui/rerun_menu.rs index b9be3a01645f..45c375bccc77 100644 --- a/crates/viewer/re_viewer/src/ui/rerun_menu.rs +++ b/crates/viewer/re_viewer/src/ui/rerun_menu.rs @@ -4,7 +4,7 @@ use egui::NumExt as _; use re_log_types::TimeZone; use re_ui::{UICommand, UiExt as _}; -use re_viewer_context::{StoreContext, SystemCommand, SystemCommandSender}; +use re_viewer_context::StoreContext; use crate::App; @@ -82,7 +82,7 @@ impl App { ui.menu_button("Options", |ui| { ui.style_mut().wrap_mode = Some(egui::TextWrapMode::Extend); - options_menu_ui(&self.command_sender, ui, frame, &mut self.state.app_options); + options_menu_ui(ui, frame, &mut self.state.app_options); }); #[cfg(debug_assertions)] @@ -295,7 +295,6 @@ fn render_state_ui(ui: &mut egui::Ui, render_state: &egui_wgpu::RenderState) { } fn options_menu_ui( - command_sender: &re_viewer_context::CommandSender, ui: &mut egui::Ui, frame: &eframe::Frame, app_options: &mut re_viewer_context::AppOptions, @@ -355,7 +354,7 @@ fn options_menu_ui( { ui.add_space(SPACING); ui.label("Experimental features:"); - experimental_feature_ui(command_sender, ui, app_options); + experimental_feature_ui(ui, app_options); } if let Some(_backend) = frame @@ -376,29 +375,12 @@ fn options_menu_ui( } } -fn experimental_feature_ui( - command_sender: &re_viewer_context::CommandSender, - ui: &mut egui::Ui, - app_options: &mut re_viewer_context::AppOptions, -) { +fn experimental_feature_ui(ui: &mut egui::Ui, app_options: &mut re_viewer_context::AppOptions) { #[cfg(not(target_arch = "wasm32"))] ui .re_checkbox(&mut app_options.experimental_space_view_screenshots, "Space view screenshots") .on_hover_text("Allow taking screenshots of 2D and 3D space views via their context menu. Does not contain labels."); - if ui - .re_checkbox( - &mut app_options.experimental_dataframe_space_view, - "Dataframe space view", - ) - .on_hover_text("Enable the experimental dataframe space view.") - .clicked() - { - command_sender.send_system(SystemCommand::EnableExperimentalDataframeSpaceView( - app_options.experimental_dataframe_space_view, - )); - } - ui.re_checkbox( &mut app_options.plot_query_clamping, "Plots: query clamping", diff --git a/crates/viewer/re_viewer_context/src/app_options.rs b/crates/viewer/re_viewer_context/src/app_options.rs index 22b0948e60b3..1d14cd3e6b25 100644 --- a/crates/viewer/re_viewer_context/src/app_options.rs +++ b/crates/viewer/re_viewer_context/src/app_options.rs @@ -17,9 +17,6 @@ pub struct AppOptions { #[cfg(not(target_arch = "wasm32"))] pub experimental_space_view_screenshots: bool, - /// Enable experimental dataframe space views. - pub experimental_dataframe_space_view: bool, - /// Toggle query clamping for the plot visualizers. pub plot_query_clamping: bool, @@ -53,8 +50,6 @@ impl Default for AppOptions { #[cfg(not(target_arch = "wasm32"))] experimental_space_view_screenshots: false, - experimental_dataframe_space_view: false, - plot_query_clamping: true, show_picking_debug_overlay: false, diff --git a/crates/viewer/re_viewer_context/src/command_sender.rs b/crates/viewer/re_viewer_context/src/command_sender.rs index 0cecc66c2cb3..ebe85b1f7f83 100644 --- a/crates/viewer/re_viewer_context/src/command_sender.rs +++ b/crates/viewer/re_viewer_context/src/command_sender.rs @@ -62,9 +62,6 @@ pub enum SystemCommand { #[cfg(debug_assertions)] EnableInspectBlueprintTimeline(bool), - /// Enable or disable the experimental dataframe space views. - EnableExperimentalDataframeSpaceView(bool), - /// Set the item selection. SetSelection(crate::Item), diff --git a/crates/viewer/re_viewer_context/src/test_context.rs b/crates/viewer/re_viewer_context/src/test_context.rs index e2e9cd9f2835..7793f5188252 100644 --- a/crates/viewer/re_viewer_context/src/test_context.rs +++ b/crates/viewer/re_viewer_context/src/test_context.rs @@ -161,8 +161,7 @@ impl TestContext { | SystemCommand::ClearAndGenerateBlueprint | SystemCommand::ActivateRecording(_) | SystemCommand::CloseStore(_) - | SystemCommand::CloseAllRecordings - | SystemCommand::EnableExperimentalDataframeSpaceView(_) => handled = false, + | SystemCommand::CloseAllRecordings => handled = false, #[cfg(debug_assertions)] SystemCommand::EnableInspectBlueprintTimeline(_) => handled = false,