Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the internal u64 part of TileId #40

Merged
merged 3 commits into from
Jan 2, 2024
Merged

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Dec 19, 2023

This makes it significantly easier to map to and from other externally managed ids.

Also, uncovered and resolved a related issue to inserting arbitrary ids into a new tree by checking for collisions on insert.

@jleibs jleibs force-pushed the jleibs/expose_tile_id branch from f0c5263 to dcdcde1 Compare December 19, 2023 16:54
jleibs added a commit to rerun-io/rerun that referenced this pull request Dec 21, 2023
### What
- Resolves: #4285
- Depends on egui_tiles PR:
rerun-io/egui_tiles#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)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/68e28bbea937694f026734f69893c24f1be6692b/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
Wumpf pushed a commit to rerun-io/rerun that referenced this pull request Dec 22, 2023
### What
- Resolves: #4285
- Depends on egui_tiles PR:
rerun-io/egui_tiles#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)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/68e28bbea937694f026734f69893c24f1be6692b/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
src/tile.rs Show resolved Hide resolved
src/tiles.rs Outdated Show resolved Hide resolved
@jleibs jleibs added the enhancement New feature or request label Jan 2, 2024
@jleibs jleibs merged commit 93e72d0 into main Jan 2, 2024
6 of 9 checks passed
@jleibs jleibs deleted the jleibs/expose_tile_id branch January 2, 2024 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants