From e5a011ae44f5ed7bc7df5e3fa943ae117eb01245 Mon Sep 17 00:00:00 2001 From: Clement Rey Date: Wed, 11 Dec 2024 16:44:57 +0100 Subject: [PATCH] bring back the two extensions i accidentally killed --- .../src/blueprint/components/auto_layout_ext.rs | 10 ++++++++++ crates/store/re_types/src/blueprint/components/mod.rs | 1 + crates/store/re_types/src/blueprint/datatypes/mod.rs | 1 + .../re_types/src/blueprint/datatypes/utf8list_ext.rs | 8 ++++++++ crates/viewer/re_viewer/src/reflection/mod.rs | 2 +- 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 crates/store/re_types/src/blueprint/components/auto_layout_ext.rs create mode 100644 crates/store/re_types/src/blueprint/datatypes/utf8list_ext.rs diff --git a/crates/store/re_types/src/blueprint/components/auto_layout_ext.rs b/crates/store/re_types/src/blueprint/components/auto_layout_ext.rs new file mode 100644 index 000000000000..79573e7901fe --- /dev/null +++ b/crates/store/re_types/src/blueprint/components/auto_layout_ext.rs @@ -0,0 +1,10 @@ +use crate::datatypes::Bool; + +use super::AutoLayout; + +impl Default for AutoLayout { + #[inline] + fn default() -> Self { + Self(Bool(true)) + } +} diff --git a/crates/store/re_types/src/blueprint/components/mod.rs b/crates/store/re_types/src/blueprint/components/mod.rs index e0fcb615bac2..7933d51c393a 100644 --- a/crates/store/re_types/src/blueprint/components/mod.rs +++ b/crates/store/re_types/src/blueprint/components/mod.rs @@ -3,6 +3,7 @@ mod active_tab; mod apply_latest_at; mod auto_layout; +mod auto_layout_ext; mod auto_views; mod background_kind; mod column_share; diff --git a/crates/store/re_types/src/blueprint/datatypes/mod.rs b/crates/store/re_types/src/blueprint/datatypes/mod.rs index 1ec5aaa4b214..3998c09c31b9 100644 --- a/crates/store/re_types/src/blueprint/datatypes/mod.rs +++ b/crates/store/re_types/src/blueprint/datatypes/mod.rs @@ -7,6 +7,7 @@ mod filter_is_not_null; mod selected_columns; mod tensor_dimension_index_slider; mod utf8list; +mod utf8list_ext; pub use self::component_column_selector::ComponentColumnSelector; pub use self::filter_by_range::FilterByRange; diff --git a/crates/store/re_types/src/blueprint/datatypes/utf8list_ext.rs b/crates/store/re_types/src/blueprint/datatypes/utf8list_ext.rs new file mode 100644 index 000000000000..1b6082caaa61 --- /dev/null +++ b/crates/store/re_types/src/blueprint/datatypes/utf8list_ext.rs @@ -0,0 +1,8 @@ +use super::Utf8List; + +impl Utf8List { + /// Iterates through the list of strings as Rust `str` references. + pub fn iter(&self) -> impl Iterator { + self.0.iter().map(|s| s.as_str()) + } +} diff --git a/crates/viewer/re_viewer/src/reflection/mod.rs b/crates/viewer/re_viewer/src/reflection/mod.rs index 1f1eb831fefb..078c12c34885 100644 --- a/crates/viewer/re_viewer/src/reflection/mod.rs +++ b/crates/viewer/re_viewer/src/reflection/mod.rs @@ -53,7 +53,7 @@ fn generate_component_reflection() -> Result::name(), ComponentReflection { docstring_md: "Whether the viewport layout is determined automatically.", - custom_placeholder: None, + custom_placeholder: Some(AutoLayout::default().to_arrow2()?), datatype: AutoLayout::arrow2_datatype(), }, ),