From c621d90044a039b58d1b5a8fef25216af257a853 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Thu, 21 Dec 2023 21:36:18 +0100 Subject: [PATCH] Introduce a new archetype for Containers (#4580) ### What - Resolves: https://github.com/rerun-io/rerun/issues/4285 - Depends on egui_tiles PR: https://github.com/rerun-io/egui_tiles/pull/40 **Best reviewed commit-by-commit** This introduces a new blueprint archetype for Containers. Although eventually we want to do direct modification of the blueprint via the same sort of `set_` pattern, I decided it would make for easier starting point / sanity check to re-implement an equivalent "end-of-frame" sync. This now only runs when some form of manual edit has happened to the blueprint. A simplfication pass also keeps us from storing the trivial tabs back into the store, making the ContainerBlueprint structure a better authoritative view of our layout for things like the Tree UI. Since it's still somewhat unstable, the new behavior is guarded by a new experimental flag that can be enabled / disabled. ### Important Details When building up the TileTree from the blueprint we use TileIds that are a function of the BlueprintId for the containing tile. This simplifies construction since we know from our `IncludedContents` component exactly which tiles the inserted content will map to, even if it hasn't been inserted yet. When mapping the tile back to the blueprint store, we still need to scan all of the tiles to figure out what content ids they should map to. If the tile-id matches a known cotntainer-id from the blueprint, then we update the corresponding container, preserving the id. We also do some simplification during this pass and "trivial tabs" instead get mapped directly to their space-views so they don't need to show up in the blueprint container. ### Known issues - Grid holes aren't tracked because egui_tiles doesn't expose these through a public API. ### 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 newly built examples: [app.rerun.io](https://app.rerun.io/pr/4580/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/4580/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [app.rerun.io](https://app.rerun.io/pr/4580/index.html?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 - [PR Build Summary](https://build.rerun.io/pr/4580) - [Docs preview](https://rerun.io/preview/68e28bbea937694f026734f69893c24f1be6692b/docs) - [Examples preview](https://rerun.io/preview/68e28bbea937694f026734f69893c24f1be6692b/examples) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)