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

Better origin heuristics for "Add entities to new space view" #5423

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Mar 7, 2024

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

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!

@abey79 abey79 added ui concerns graphical user interface exclude from changelog PRs with this won't show up in CHANGELOG.md heuristics Heuristics for placing views, fallback provider, etc. labels Mar 7, 2024
@abey79 abey79 requested a review from Wumpf March 8, 2024 08:09
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, this worked out even better than I thought!


// Find the first ViewCoordinates3d logged, walking up from the common ancestor to the
// subspace origin.
EntityPath::incremental_walk(subspace_origin.as_ref(), &common_ancestor)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh cool I didn't know this utility, this makes this relatively complicated operation here quite readable <3

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nor did I but I was certainly happy to find it :)

@Wumpf Wumpf merged commit 8834a8a into main Mar 8, 2024
34 of 35 checks passed
@Wumpf Wumpf deleted the antoine/better-origin-heuristics branch March 8, 2024 09:05
abey79 added a commit that referenced this pull request Mar 18, 2024
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md heuristics Heuristics for placing views, fallback provider, etc. ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants