-
Notifications
You must be signed in to change notification settings - Fork 394
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
Filter entities in the UI (part 6): Refactor re_blueprint_tree
and add more tests
#8795
Conversation
fixed bug in data fixed data
test passing for old code improved test code fixed test
fixed blueprint
Web viewer built successfully. If applicable, you should also test it:
Note: This comment is updated whenever you push a commit. |
974a30a
to
e0dbdf4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
result_tree.visit(&mut |node| { | ||
if node | ||
.data_result | ||
.entity_path | ||
.starts_with(&view_blueprint.space_origin) | ||
{ | ||
// If it's under the origin, we're not interested, stop recursing. | ||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this code it's not immediately obvious what returning false
from visit
means. It's not a huge issue, but it could probably be made easier to read by using something like std::ops::ControlFlow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call! This existing visit
method is used in a bunch of places so I won't change it here, but I'll keep that in mind and might do a separate cleanup PR.
Co-authored-by: Emil Ernerfeldt <[email protected]>
Co-authored-by: Emil Ernerfeldt <[email protected]>
Co-authored-by: Emil Ernerfeldt <[email protected]>
Related
CustomContent
more useful #8645re_blueprint_tree
and add more tests #8795re_time_panel
and add more tests #8863What
This PR introduces a complete refactor of the blueprint tree to split the data processing part (including filtering) and the UI part. It also introduce a bunch of UI snapshot and insta tests to protect us against regressions.
Visual changes
This refactor highlighted a number of bugs and inconsistencies in the way we're presenting the blueprint tree.
Example of a bug (wrong highlighting of the '(root)' label:
Example of an inconsistency (we display an origin stub but wouldn't match on it):
Performance
Technically, this PR introduce a performance regression in the sense that we now always walk the entire tree to extract data, even if such data is not needed—e.g. because the display is fully collapsed and not filtered.
However, benchmark have shown that this overhead is very small, and far outweighed by the gain in code clarity.
Full benchmark analysis/discussion on slack: https://rerunio.slack.com/archives/C041NHU952S/p1737709242394899
TL;DR: 0.3ms in a complex case where the entire blueprint tree takes 3.6ms.
Comparing with 0.21 shows not significant regression.
This PR:
0.21.0:
setup used: