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

Use proper components more directly in blueprint datastructures #4155

Closed
jleibs opened this issue Nov 6, 2023 · 1 comment
Closed

Use proper components more directly in blueprint datastructures #4155

jleibs opened this issue Nov 6, 2023 · 1 comment
Assignees
Labels
🟦 blueprint The data that defines our UI

Comments

@jleibs
Copy link
Member

jleibs commented Nov 6, 2023

The current blueprint logic stores both a mutable blueprint, and a start-of-frame snapshot in the viewport.

At the end of each frame, a call to sync_blueprint_changes walks through these two data-structures to find any diffs and then saves those back to the blueprint store. This is both convoluted and hard to maintain .

Instead we want to be able to map individual UI actions directly to blueprint write operations at a specific path / component.

@jleibs jleibs added the 🟦 blueprint The data that defines our UI label Nov 6, 2023
@emilk
Copy link
Member

emilk commented Nov 7, 2023

jleibs added a commit that referenced this issue Dec 15, 2023
### What

Resolves:
 - #4155
 - #4440

Lots of refactoring and untangling here:
- `ViewportBlueprint` is a thin wrapper around the Archetype -- it is
now always read-only.
- All the runtime-mutable stuff (specifically the tree /
deferred-tree-actions) are moved out of ViewportBlueprint and into
Viewport
- Subsequently a couple of the UI eliminate now take a `&mut Viewport`
instead of a &mut ViewportBlueprint
- Almost all modifications are now made by calling `set_<prop>` APIs
which emit a deferred component-write directly to the blueprint.
- The one remaining complex type is the ViewportLayout which is still
stored as a single component. The deferred update logic for the tree is
now done at the end of the frame, followed by a single component-update.
   
### 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):
  * Full build: [app.rerun.io](https://app.rerun.io/pr/4524/index.html)
* Partial build:
[app.rerun.io](https://app.rerun.io/pr/4524/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
- Useful for quick testing when changes do not affect examples in any
way
* [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/4524)
- [Docs
preview](https://rerun.io/preview/db702308b1658fe691878c7976b445ba5623b72a/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/db702308b1658fe691878c7976b445ba5623b72a/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
@jleibs jleibs closed this as completed Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🟦 blueprint The data that defines our UI
Projects
None yet
Development

No branches or pull requests

2 participants