diff --git a/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs b/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs index 3aa10c059ac7..40ddb42900c1 100644 --- a/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs +++ b/crates/viewer/re_viewer_context/src/space_view/space_view_class_placeholder.rs @@ -1,10 +1,11 @@ +use re_types::SpaceViewClassIdentifier; +use re_ui::UiExt; + use crate::{ SpaceViewClass, SpaceViewClassRegistryError, SpaceViewSpawnHeuristics, SpaceViewState, SpaceViewSystemExecutionError, SpaceViewSystemRegistrator, SystemExecutionOutput, ViewQuery, ViewerContext, }; -use re_types::SpaceViewClassIdentifier; -use re_ui::UiExt; /// A placeholder space view class that can be used when the actual class is not registered. #[derive(Default)] @@ -24,7 +25,7 @@ impl SpaceViewClass for SpaceViewClassPlaceholder { } fn help_markdown(&self, _egui_ctx: &egui::Context) -> String { - "The space view class was not recognized.\n\nThis happens if either the blueprint specifies an invalid space view class or this version of the viewer does not know about this type.".to_owned() + "Placeholder view for unknown space view class".to_owned() } fn on_register( @@ -48,13 +49,27 @@ impl SpaceViewClass for SpaceViewClassPlaceholder { fn ui( &self, - ctx: &ViewerContext<'_>, + _ctx: &ViewerContext<'_>, ui: &mut egui::Ui, _state: &mut dyn SpaceViewState, _query: &ViewQuery<'_>, _system_output: SystemExecutionOutput, ) -> Result<(), SpaceViewSystemExecutionError> { - ui.markdown_ui(&self.help_markdown(ctx.egui_ctx)); + egui::Frame { + inner_margin: egui::Margin::same(re_ui::DesignTokens::view_padding()), + ..Default::default() + } + .show(ui, |ui| { + ui.warning_label("Unknown space view class"); + + ui.markdown_ui( + "This happens if either the blueprint specifies an invalid space view class or \ + this version of the viewer does not know about this type.\n\n\ + \ + **Note**: some views may require a specific Cargo feature to be enabled. In \ + particular, the map view requires the `map_view` feature.", + ); + }); Ok(()) }