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

Add Examples page to the Welcome Screen #3191

Merged
merged 25 commits into from
Sep 6, 2023
Merged

Add Examples page to the Welcome Screen #3191

merged 25 commits into from
Sep 6, 2023

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Sep 3, 2023

What

Add Example page to the Welcome Screen.

Note

This PR bakes in the example thumbnails, which will incur a significant bump in the wasm build. We will remove this once we pull thumbnails from the web using emilk/egui#3291.

Fixes #3096

image

TODO

Not included in this PR

Checklist

@abey79 abey79 added enhancement New feature or request ui concerns graphical user interface labels Sep 3, 2023
@github-actions
Copy link

github-actions bot commented Sep 3, 2023

Size changes

Name main 3191/merge Change
Wasm 14.46 MiB 15.34 MiB +6.09%

@abey79 abey79 requested a review from martenbjork September 4, 2023 07:57
@emilk
Copy link
Member

emilk commented Sep 5, 2023

I looks amazing 😍

But clicking one feels extremely unresponsive, as there is no indication that your click came through. As you noted before, we need to add a load-screen asap.

should_show_welcome_screen is doing the right thing, but we never disable the app id once the heuristic change.

In other words, I believe this needs an else statement to show the loading screen:

        if self.should_show_welcome_screen(&mut store_hub) {
            store_hub.set_app_id(StoreHub::welcome_screen_app_id());
        }

@abey79
Copy link
Member Author

abey79 commented Sep 5, 2023

@emilk I gave it a quick try but.... it's not that simple (I got all sorts of weird behaviour whose fixing feels beyond the scope of this PR). For the purpose of this PR, I'd like to give some kind of visual feedback (some flashing?) to indicate that the click has been registered, and address the progress feedback in a follow-up PR.

@abey79 abey79 mentioned this pull request Sep 5, 2023
3 tasks
@martenbjork
Copy link
Contributor

martenbjork commented Sep 6, 2023

Almost ready to go! 🚀

Here are some tiny tweaks:

Frame 33

Typography notes

  • It's important to add line height to all text elements, even when they are single line. Without that, the margin calculations become incorrect. An element with a tiny line height looks closer to the element below than an element with a huge line height).
  • The heading sizes and font sizes used in this view should be the same as on the welcome screen. That is:

Headlines (Connect to live data, Rust, Python, Configure your views, [example name])

font-size: 15px
line-height: 22px
font-weight: 550 

Body text

font-size: 13px
line-height: 19px
font-weight: 490 (this will be the new base font weight for the entire app)

Spinner

Can we make the spinner a little less big? It's so large right now, it looks pretty jarring. Something like this:

Spinner height: 72px;
Image opacity: 0.25
Frame 35

@abey79
Copy link
Member Author

abey79 commented Sep 6, 2023

@martenbjork thanks for the detailed feedback—will try to implement as much as possible.

On font weight: I don't believe egui currently has support for font weight (emilk/egui#3218), so we're stuck with whatever is the default.

@abey79
Copy link
Member Author

abey79 commented Sep 6, 2023

Also, I understand the "copy to tags" vertical space and the "32px vertical gap" to be minimal values, as the effective gap depends on the corresponding thumbnail aspect ratio (tags are grid aligned too).

@martenbjork
Copy link
Contributor

Also, I understand the "copy to tags" vertical space and the "32px vertical gap" to be minimal values, as the effective gap depends on the corresponding thumbnail aspect ratio (tags are grid aligned too).

Yes! 💯

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

I love it, but I suggest we wait for emilk/egui#3297 to be merged (any minute now) and the update the PR to use it.

crates/re_viewer/src/ui/welcome_screen/example_page.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/welcome_screen/example_page.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/welcome_screen/example_page.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/welcome_screen/mod.rs Outdated Show resolved Hide resolved
@jprochazk
Copy link
Member

jprochazk commented Sep 6, 2023

emilk/egui#3297 has been merged, and this would be the perfect PR to test it on!

The new API is:

// during setup
egui_extras::loaders::install(&egui_ctx);

// when you want to load an image
ui.image2("http://link.to.image.com/image.png");

Will also need to enable some features on egui_extras if they aren't already.

@abey79
Copy link
Member Author

abey79 commented Sep 6, 2023

@jprochazk I'll get on it this afternoon.

Copy link
Member

@emilk emilk left a comment

Choose a reason for hiding this comment

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

Awesome!

crates/re_viewer/src/ui/welcome_screen/example_page.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/welcome_screen/mod.rs Outdated Show resolved Hide resolved
@abey79 abey79 merged commit cb197a2 into main Sep 6, 2023
@abey79 abey79 deleted the antoine/example-list branch September 6, 2023 15:34
emilk added a commit that referenced this pull request Sep 7, 2023
### What

This PR:
- implements a refreshed, toned-down Welcome Page;
- add the panel linking  to the examples page;
- make the UI responsive.

This is a PR train, #3191 must be reviewed/fixed/merged first.

Fixes:
 - #3124
 - #3043

<img width="1608" alt="image"
src="https://github.com/rerun-io/rerun/assets/49431240/28e68d38-2efa-41ab-96a0-2891bee59ea3">


### 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 [demo.rerun.io](https://demo.rerun.io/pr/3219) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3219)
- [Docs
preview](https://rerun.io/preview/53fef8c10871100e6aef8a2e49aff9d28e6cac6f/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/53fef8c10871100e6aef8a2e49aff9d28e6cac6f/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)

---------

Co-authored-by: Emil Ernerfeldt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "browsing examples" section to the Welcome Screen
4 participants