From 8812c69344cb454b65476f827ec89afe197c6dfd Mon Sep 17 00:00:00 2001 From: jprochazk <1665677+jprochazk@users.noreply.github.com> Date: Wed, 22 May 2024 17:09:26 +0200 Subject: [PATCH 1/7] panel state --- Cargo.lock | 1 + .../latest_at/to_archetype/panel_blueprint.rs | 8 +- crates/re_time_panel/Cargo.toml | 1 + crates/re_time_panel/src/lib.rs | 7 +- .../re_types/definitions/rerun/blueprint.fbs | 2 +- .../blueprint/archetypes/panel_blueprint.fbs | 3 +- .../{panel_expanded.fbs => panel_state.fbs} | 9 +- .../re_types/definitions/rerun/datatypes.fbs | 1 + .../rerun/datatypes/panel_state.fbs | 21 +++ .../src/blueprint/components/.gitattributes | 2 +- .../re_types/src/blueprint/components/mod.rs | 4 +- .../{panel_expanded.rs => panel_state.rs} | 73 ++++---- crates/re_types/src/datatypes/.gitattributes | 1 + crates/re_types/src/datatypes/mod.rs | 3 + crates/re_types/src/datatypes/panel_state.rs | 162 ++++++++++++++++++ .../re_types/src/datatypes/panel_state_ext.rs | 18 ++ .../blueprint/archetypes/panel_blueprint.rs | 44 +++-- crates/re_viewer/src/app_blueprint.rs | 97 +++++++---- crates/re_viewer/src/app_state.rs | 9 +- .../src/blueprint/validation_gen/mod.rs | 4 +- crates/re_viewer/src/ui/top_panel.rs | 9 +- docs/content/reference/types/datatypes.md | 1 + .../reference/types/datatypes/.gitattributes | 1 + .../reference/types/datatypes/panel_state.md | 19 ++ .../blueprint/archetypes/panel_blueprint.cpp | 4 +- .../blueprint/archetypes/panel_blueprint.hpp | 10 +- rerun_cpp/src/rerun/blueprint/components.hpp | 2 +- .../rerun/blueprint/components/.gitattributes | 2 +- .../blueprint/components/panel_expanded.hpp | 61 ------- .../blueprint/components/panel_state.hpp | 60 +++++++ rerun_cpp/src/rerun/datatypes.hpp | 1 + rerun_cpp/src/rerun/datatypes/.gitattributes | 2 + rerun_cpp/src/rerun/datatypes/panel_state.cpp | 62 +++++++ rerun_cpp/src/rerun/datatypes/panel_state.hpp | 55 ++++++ .../blueprint/archetypes/panel_blueprint.py | 24 +-- .../rerun/blueprint/components/.gitattributes | 2 +- .../rerun/blueprint/components/__init__.py | 8 +- .../blueprint/components/panel_expanded.py | 28 --- .../rerun/blueprint/components/panel_state.py | 28 +++ .../rerun_sdk/rerun/datatypes/.gitattributes | 1 + .../rerun_sdk/rerun/datatypes/__init__.py | 6 + .../rerun_sdk/rerun/datatypes/panel_state.py | 95 ++++++++++ 42 files changed, 702 insertions(+), 249 deletions(-) rename crates/re_types/definitions/rerun/blueprint/components/{panel_expanded.fbs => panel_state.fbs} (61%) create mode 100644 crates/re_types/definitions/rerun/datatypes/panel_state.fbs rename crates/re_types/src/blueprint/components/{panel_expanded.rs => panel_state.rs} (62%) create mode 100644 crates/re_types/src/datatypes/panel_state.rs create mode 100644 crates/re_types/src/datatypes/panel_state_ext.rs create mode 100644 docs/content/reference/types/datatypes/panel_state.md delete mode 100644 rerun_cpp/src/rerun/blueprint/components/panel_expanded.hpp create mode 100644 rerun_cpp/src/rerun/blueprint/components/panel_state.hpp create mode 100644 rerun_cpp/src/rerun/datatypes/panel_state.cpp create mode 100644 rerun_cpp/src/rerun/datatypes/panel_state.hpp delete mode 100644 rerun_py/rerun_sdk/rerun/blueprint/components/panel_expanded.py create mode 100644 rerun_py/rerun_sdk/rerun/blueprint/components/panel_state.py create mode 100644 rerun_py/rerun_sdk/rerun/datatypes/panel_state.py diff --git a/Cargo.lock b/Cargo.lock index bfc1f2560526..62e7b04b302c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4836,6 +4836,7 @@ dependencies = [ "re_format", "re_log_types", "re_tracing", + "re_types", "re_ui", "re_viewer_context", "re_viewport", diff --git a/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs b/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs index acf76c2788dd..7e9a0fea77af 100644 --- a/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs +++ b/crates/re_query/src/latest_at/to_archetype/panel_blueprint.rs @@ -26,9 +26,9 @@ impl crate::ToArchetype::name()) { - match expanded.to_dense::(resolver) { + use re_types::blueprint::components::PanelState; + let state = if let Some(state) = self.get(::name()) { + match state.to_dense::(resolver) { PromiseResult::Pending => return PromiseResult::Pending, PromiseResult::Error(promise_err) => return PromiseResult::Error(promise_err), PromiseResult::Ready(query_res) => match query_res { @@ -42,7 +42,7 @@ impl crate::ToArchetype