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

Change UiVerbosity to UiLayout and tighten up related implementations #6245

Closed
1 of 3 tasks
abey79 opened this issue May 7, 2024 · 0 comments · Fixed by #6297
Closed
1 of 3 tasks

Change UiVerbosity to UiLayout and tighten up related implementations #6245

abey79 opened this issue May 7, 2024 · 0 comments · Fixed by #6297
Assignees
Labels
ui concerns graphical user interface

Comments

@abey79
Copy link
Member

abey79 commented May 7, 2024

Context

An important aspect of the DataUi infrastructure is the UiVerbosity enum passed by the caller, which specifies how "verbose" the UI should be. So far, verbosity levels have been relatively loosely defined: small, reduced, full. While flexible, this approach has two problems:

  • It provides very little guidance for DataUi implementors on how to deal with each verbosity level.
  • It provides callers very little guarantees on the kind of UI that might end up being generated for a given verbosity level.

Concretely, this makes some efforts difficult.

For example, #4161 requires all implementation for UiVerbosity::Small to fit inside half a list item, whereas some implementation actually span multiple lines.

Likewise, using full-span widgets such as list item in DataUi is complicated because it's currently ill-defined whether a give verbosity level implies that a full_span_scope is defined or not (#6246).

A very partial attempt at resolving this was included in #4416, where distinct verbosity level were created specifically for single-selection vs. multi-selection Selection Panel.

Current use of UiVerbosity

  • UiVerbosity::Small:
    • InstancePath::data_ui() delegating to component's data_ui()
    • EntityLatestAtResults::data_ui() delegating to component's data_ui()
    • override_ui() delegating to component's data_ui()
    • DataFrame space view, for displaying component in the table
    • image_hover_ui delegating to TensorData::data_ui()
  • UiVerbosity::Reduced: used in many places, but always as part of some hover tooltip
  • UiVerbosity::LimitHeight and UiVerbosity::Full: only used by the selection panel

Propsal

Related

@abey79 abey79 added the ui concerns graphical user interface label May 7, 2024
@abey79 abey79 self-assigned this May 7, 2024
abey79 added a commit that referenced this issue May 8, 2024
### What

Migrate all widgets to the "full span scope" mechanism introduced in
#6211, including the legacy `ListItem`. This completes the migration
away from the clip rect hack, but does highlight a number of issues and
improvements:
- #6245 
- #6246

Showcase of `full_span_scope()` nestability:

<img width="324" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/be8e72b1-7f1d-4533-a456-870a8c51572d">
<br/> <br/>


- Fixes #6156

### 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 examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6248?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6248?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/6248)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
abey79 added a commit that referenced this issue May 10, 2024
### What

This PR adds a release checklist where all of our components are logged,
with an exhaustivity check. This makes it easy to see all relevant
`DataUi` implementations at the same place. All components are logged as
n=1 batches. Some are logged as n>1 batches as well. And others are
logged with multiple alternative contents.

This already highlight some issues with the current implementation.

Also fixes an URL to appease the link checker.

- part of #6245 


<img width="504" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/82a6a20c-145d-4216-834d-0ddd0073caf1">

<img width="206" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/d6fce911-3758-462e-9849-e15c2a2e07ff">

<img width="397" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/28abd543-44e7-4e17-b058-a388f285e4ea">

<img width="325" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/996ad8d5-2671-427d-b813-d5a6a6d743f8">


### 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 examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6267?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6267?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/6267)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
@abey79 abey79 changed the title Change UiVerbosity to UiContext and tighten up related implementations Change UiVerbosity to UiLayout and tighten up related implementations May 13, 2024
abey79 added a commit that referenced this issue May 13, 2024
…#6291)

### What

* part of #6245 

Pure refactor. The second commit clarify the meaning of the various
`UiLayout` variants. The other commits are just renames.

### 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 examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6291?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6291?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/6291)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
abey79 added a commit that referenced this issue May 14, 2024
### What

- Follow up to #6291 
- Fixes #6245 
- Unblocks #4161
- Limitation #6315

This PR fixes the `UiLayout::List` implementations of `DataUi` such that
they all fit on a single line and are deal with potentially narrow space
(mostly via truncation).

This PR unearthed quite some inconsistencies in how we're using
monospace font for data. For now, `text_ui` (which uses monospace) has
been renamed `data_label_for_ui_layout` to parallel the new
`label_for_ui_layout` (which uses proportional). In the future (#6315),
we must unify both with a better, flexible API that also allows mixed
styles.

TODO:
- [x] blob: check with large binaries -> OK (could certainly be improved
but it truncates correct 🤷🏻)
- [x] tensor data: fix ui for `size(shape) > 3`
- [x] range2d: improve label

### Screenshots

<img width="488" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/e82c83c1-0f2b-4d64-9e76-71d28e3cba5c">
<img width="501" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/da811427-cad2-463e-8285-9ae096441fc5">
<img width="369" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/987af231-43c6-44e5-babb-52efdf110e30">
<img width="314" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/2a4174bf-8117-46e5-9734-5e3ac05dd209">
<img width="231" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/4fdc4e02-f6ff-43fc-8a68-163985ee0186">
<br/><br/>

When truncated:

<img width="228" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/cbfbbb79-df18-48e9-be82-0401feec9d93">


### 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 examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6297?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6297?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/6297)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ui concerns graphical user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant