-
Notifications
You must be signed in to change notification settings - Fork 373
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
More context menu 4: create a new space view with selected entities #5411
Conversation
Awesome! Related to your comment on the need to show what is visualizable. That would ideally also be shown in the list of choices for view |
Good call. I'm assuming it would be rather easy to do based only on the space origin (aka the clicked item). It might be tricker to do if we reason on all selected entities. @Wumpf and/or @jleibs we may want to shortly discuss that this afternoon. |
I |
18a252f
to
4a94ddc
Compare
510f743
to
30ed5d2
Compare
30ed5d2
to
9ac7d5f
Compare
@Wumpf PR updated with the recommendation. Happy to take your feedback on the following weirdnesses. Doesn't recommend 2D when clearly this is a 2D thing (as it shows up in a 2D space view): Doesn't recommend anything when clearly that's a very good thing to set in space view: |
This is the exact same issue as the "black space view" we discussed earlier. Under current rules the keypoints are not visualizable in
If I'm not mistaken your code checks for the exact path to have a visualizer. |
# Conflicts: # crates/re_viewport/src/context_menu/actions.rs
I've now done exactly that. |
there's definitely some more weirdness going on beyond the known bugs. E.g. another one (?): I tried putting a markdown document in a text log since it suggested that and it doesn't show (I expected a line to show). |
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.
Mostly nits, but the potentially superfluous label should be fixed before going in.
Looking good otherwise!
@@ -173,6 +174,11 @@ fn show_context_menu_for_selection(ctx: &ContextMenuContext<'_>, ui: &mut egui:: | |||
|
|||
should_display_separator |= any_action_displayed; | |||
} | |||
|
|||
// nothing was shown, make sure the context menu isn't empty | |||
if !should_display_separator { |
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.
[not actionable] this method is getting weirder, heh. Last time I already was staring at it trying to figure out how to express this whole thing simpler, but I'm still a bit at a loss 🤷
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.
Yeah, that flag has double-duty. I started by adding a new was_anything_added
flag, and it turned out to be implemented exactly like should_display_separator
. Let's see if some renaming may help here.
let covered = entities_of_interest.iter().all(|entity| { | ||
visualizable_entities.0.iter().any(|(_, entities)| { | ||
entities | ||
.0 | ||
.iter() | ||
.any(|e| e == *entity || e.is_descendant_of(entity)) | ||
}) | ||
}); |
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.
[not actionable]
oof that's a lot of entities to walk through if the user happens to select many. Ah well it happens only on-click and what are the odds of the user selecting everything.. right.. ;-)
We need to get establish better patterns & algorithms using prefix tree operations for things like this 🤔
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.
Hopefully all
's short-circuit should help us in most cases 🤞🏻
### What Follow up to #5411. This PR provides a better heuristics for the the default space origin with 2D and 3D space view. See the original PR for the (updated) design decision section. ### 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/5423/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5423/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/5423/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 * [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/5423) - [Docs preview](https://rerun.io/preview/d50861028fe4f09576a16ed46196c04bf4e5dd04/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/d50861028fe4f09576a16ed46196c04bf4e5dd04/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
### What NOTE: review commit by commit (first commit is pure refactoring). Final PR in the series. This PR: - split `actions.rs` into many sub-files - fix capitalisation in some menu item - split the release check list in small checks Full series: - #5392 - #5397 - #5407 - #5411 - #5422 - #5433 - #5456 ### 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/5456/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5456/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/5456/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 * [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/5456) - [Docs preview](https://rerun.io/preview/a36360f586494f6648fdc4bbb9d806ab12911358/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/a36360f586494f6648fdc4bbb9d806ab12911358/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
…5565) ### What Fix a bug introduced in #5411 and #5423 where the wrong origin would be suggested when creating a 3D space view from an entity part of a 2D space view. Quoting the original PR: > For 3D space views: the origin of the subspace that contains the selected entities common ancestor, _or_, if that one is rooted on a pinhole, the origin of the parent sub-space. Further, if a `ViewCoordinate` is logged in between the subspace origin and the common ancestor, then it's used as suggested origin. In most case, that means `/`, unless a `DisconnectedSpace` is encountered. The part of that logic where we check for a `ViewCoordinate` in the parent subspace was implemented incorrectly, which resulted in `check_context_menu_suggested_origin` to fail. With this PR, this test now passes. ### 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/5565/index.html) * Using examples from latest `main` build: [app.rerun.io](https://app.rerun.io/pr/5565/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/5565/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 * [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/5565) - [Docs preview](https://rerun.io/preview/268125aaddc63e0524743528cf3b34c9ea0640e3/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/268125aaddc63e0524743528cf3b34c9ea0640e3/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
What
As the title says ☝🏻
DataResults
#5299Also adds a "no action available for this selection" notice that got lost in #5392.
Makes it very easy to bump into:
context_menu_new_sv_with_entities_v2.mp4
Design decisions
Note: includes changes in #5423
/
/
and the 2D space view is not suggested on ground of lack of visualizability.ViewCoordinate
is logged in between the subspace origin and the common ancestor, then it's used as suggested origin. In most case, that means/
, unless aDisconnectedSpace
is encountered./
. Reject: this behaviour is really broken for 2D space views.Known "phenomenons"
2D space views are rarely suggested, because of the origin is set to "/" and that's outside of a pinhole transform.Mostly fixed by Better origin heuristics for "Add entities to new space view" #5423Text
document.structure_from_motion
->/camera/image
structure_from_motion
) #5420Checklist
main
build: app.rerun.ionightly
build: app.rerun.io