Skip to content

Commit

Permalink
Move blueprint tree UI to new re_blueprint_tree crate (rerun-io#6427)
Browse files Browse the repository at this point in the history
### What

- Fixes rerun-io#6415

Straightforward refactor overall. Made two calls:
- Create a `ui` sub-module in `re_viewport_blueprint` to host the
`add_space_view_or_container` modal (used by both the blueprint tree and
the selection panel).
- Moved down two small utility functions in `re_viewer_context` (in
`lib.rs`).
- There was a weird double-buffering of the drop target container ID
going through `TreeAction`. This is gone in favour of a much simpler
approach (still double-buffered though).

(Chained to rerun-io#6423)


![](https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/1200w.png)

### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested the web demo (if applicable):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6427?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6427?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6427)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
  • Loading branch information
abey79 authored May 27, 2024
1 parent 36ad454 commit a4f0e72
Show file tree
Hide file tree
Showing 22 changed files with 479 additions and 353 deletions.
11 changes: 6 additions & 5 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ Of course, this will only take us so far. In the future we plan on caching queri
Here is an overview of the crates included in the project:

<picture>
<img src="https://static.rerun.io/crates/1681e343ee14bb8a72c32e818447cdf853683d64/full.png" alt="">
<source media="(max-width: 480px)" srcset="https://static.rerun.io/crates/1681e343ee14bb8a72c32e818447cdf853683d64/480w.png">
<source media="(max-width: 768px)" srcset="https://static.rerun.io/crates/1681e343ee14bb8a72c32e818447cdf853683d64/768w.png">
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/crates/1681e343ee14bb8a72c32e818447cdf853683d64/1024w.png">
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/crates/1681e343ee14bb8a72c32e818447cdf853683d64/1200w.png">
<img src="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/full.png" alt="">
<source media="(max-width: 480px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/480w.png">
<source media="(max-width: 768px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/768w.png">
<source media="(max-width: 1024px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/1024w.png">
<source media="(max-width: 1200px)" srcset="https://static.rerun.io/crates/1b123b5323a7d1366bdbd6c2fd5a788f46d20caf/1200w.png">
</picture>


Expand Down Expand Up @@ -127,6 +127,7 @@ Update instructions:

| Crate | Description |
|-----------------------------|----------------------------------------------------------------------------------------|
| re_blueprint_tree | The UI for the blueprint tree in the left panel. |
| re_viewer | The Rerun Viewer |
| re_viewport | The central viewport panel of the Rerun viewer. |
| re_time_panel | The time panel of the Rerun Viewer, allowing to control the displayed timeline & time. |
Expand Down
24 changes: 23 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4150,6 +4150,25 @@ dependencies = [
"simdutf8",
]

[[package]]
name = "re_blueprint_tree"
version = "0.17.0-alpha.2"
dependencies = [
"egui",
"itertools 0.12.0",
"re_context_menu",
"re_data_ui",
"re_entity_db",
"re_log",
"re_log_types",
"re_tracing",
"re_types",
"re_ui",
"re_viewer_context",
"re_viewport_blueprint",
"smallvec",
]

[[package]]
name = "re_build_info"
version = "0.17.0-alpha.2"
Expand Down Expand Up @@ -5025,6 +5044,7 @@ dependencies = [
"once_cell",
"poll-promise",
"re_analytics",
"re_blueprint_tree",
"re_build_info",
"re_build_tools",
"re_context_menu",
Expand Down Expand Up @@ -5141,7 +5161,6 @@ dependencies = [
"re_ui",
"re_viewer_context",
"re_viewport_blueprint",
"smallvec",
]

[[package]]
Expand All @@ -5153,6 +5172,8 @@ dependencies = [
"egui_tiles",
"itertools 0.12.0",
"nohash-hasher",
"once_cell",
"parking_lot",
"re_data_store",
"re_entity_db",
"re_log",
Expand All @@ -5161,6 +5182,7 @@ dependencies = [
"re_types",
"re_types_blueprint",
"re_types_core",
"re_ui",
"re_viewer_context",
"slotmap",
"smallvec",
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ version = "0.17.0-alpha.2"
# In particular: if we compile rerun 0.3.0-alpha.0 we only want it to use
# re_log_types 0.3.0-alpha.0, NOT 0.3.0-alpha.4 even though it is newer and semver-compatible.
re_analytics = { path = "crates/re_analytics", version = "=0.17.0-alpha.2", default-features = false }
re_blueprint_tree = { path = "crates/re_blueprint_tree", version = "=0.17.0-alpha.2", default-features = false }
re_build_info = { path = "crates/re_build_info", version = "=0.17.0-alpha.2", default-features = false }
re_build_tools = { path = "crates/re_build_tools", version = "=0.17.0-alpha.2", default-features = false }
re_crash_handler = { path = "crates/re_crash_handler", version = "=0.17.0-alpha.2", default-features = false }
Expand Down
35 changes: 35 additions & 0 deletions crates/re_blueprint_tree/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
authors.workspace = true
description = "The UI for the blueprint tree in the left panel."
edition.workspace = true
homepage.workspace = true
license.workspace = true
name = "re_blueprint_tree"
publish = true
readme = "README.md"
repository.workspace = true
rust-version.workspace = true
version.workspace = true
include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"]

[lints]
workspace = true

[package.metadata.docs.rs]
all-features = true

[dependencies]
re_context_menu.workspace = true
re_data_ui.workspace = true
re_entity_db = { workspace = true, features = ["serde"] }
re_log_types.workspace = true
re_log.workspace = true
re_tracing.workspace = true
re_types.workspace = true
re_ui.workspace = true
re_viewer_context.workspace = true
re_viewport_blueprint.workspace = true

egui.workspace = true
itertools.workspace = true
smallvec.workspace = true
10 changes: 10 additions & 0 deletions crates/re_blueprint_tree/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# re_blueprint_tree

Part of the [`rerun`](https://github.com/rerun-io/rerun) family of crates.

[![Latest version](https://img.shields.io/crates/v/re_blueprint_tree.svg)](https://crates.io/crates/re_blueprint_tree?speculative-link)
[![Documentation](https://docs.rs/re_blueprint_tree/badge.svg)](https://docs.rs/re_blueprint_tree?speculative-link)
![MIT](https://img.shields.io/badge/license-MIT-blue.svg)
![Apache](https://img.shields.io/badge/license-Apache-blue.svg)

The UI for the blueprint tree in the left panel.
Loading

0 comments on commit a4f0e72

Please sign in to comment.