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

When loading on web, match style and show a progress indicator while wasm is loading #2421

Merged
merged 11 commits into from
Jun 15, 2023

Conversation

jleibs
Copy link
Member

@jleibs jleibs commented Jun 13, 2023

What

Resolves:

According to the new design, here is how the loading state should work:

  1. HTML and CSS loads. It renders the skeleton content without any text.
  2. WASM loads. It renders the exact same skeleton content without any text. The user doesn’t notice that the rendering method switched from HTML => WASM.
  3. If loading takes long (more than 3 seconds) text fades in and provides additional information.
  4. When the App UI is ready, the skeleton content fades away (200ms duration) and the app fades in.

The first deployed test of this ended up with 300% progress during the download step, so I've added some extra handling for progress related to compressed streams.At the moment we default to an adhoc compression ratio, but once we land:

In order to make all the waiting variants more consistent, this also changes the RRD loading page.

The normal waiting page looks like:
image

Before:
image

After:
image

This PR does not handle progress indicator during the loading of the RRD itself. The hooks necessary to get access to progress feedback depend on essentially the same work already happening as part of: #2412 and just directly loading the rrd file is generally going to be better than showing a progress indicator. It could be worth revisiting this for things like blueprints with large static data.

This needs to be tested manually on our major OS / browser combinations:

Builds to test:

If your internet connection is too fast, use developer tools to throttle connection and enable cache.
image

  • Linux:
    • Chrome
    • Firefox
  • Mac:
    • Chrome
    • Firefox
    • Safari
  • Windows:
    • Chrome
    • Firefox
    • Edge

Checklist

PR Build Summary: https://build.rerun.io/pr/2421

Docs preview: https://rerun.io/preview/934925b/docs
Examples preview: https://rerun.io/preview/934925b/examples

@jleibs jleibs added the 🕸️ web regarding running the viewer in a browser label Jun 13, 2023
@jleibs jleibs force-pushed the jleibs/loading_transitions branch from fcc735f to 6cb62e9 Compare June 13, 2023 22:01
@abey79
Copy link
Member

abey79 commented Jun 14, 2023

Mac/Safari: for some reason, nothing is clickable but the rerun menu using the build test link (demo.rerun.io works fine). The loading screen does seem to be fine.

@nikolausWest
Copy link
Member

Also getting the same behavior that nothing is clickable on mac chrome

@jleibs
Copy link
Member Author

jleibs commented Jun 14, 2023

Thanks for testing; looks like I broke this for myself as well but I'd been so focused on the loading logic I forgot to test interactivity 🤦

@emilk
Copy link
Member

emilk commented Jun 14, 2023

Running https://app.rerun.io/commit/8d70d57 on a "Good 3G" connection in Firefox, Mac:

image

I guess we should clamp the display to at most 99%.

…but it is off by almost exactly 3x, which is suspicious since that is the chosen content_multiplier.

I checked, and the response headers look right:

image

@jleibs
Copy link
Member Author

jleibs commented Jun 14, 2023

@emilk

I guess we should clamp the display to at most 99%.

It looks like you're testing an old build. The fixes for that are in there but on commit: https://app.rerun.io/commit/e15ebb5

@emilk
Copy link
Member

emilk commented Jun 15, 2023

@emilk

I guess we should clamp the display to at most 99%.

It looks like you're testing an old build. The fixes for that are in there but on commit: https://app.rerun.io/commit/e15ebb5

That makes sense now. I just clicked https://build.rerun.io/pull_request/2421/index.html and assumed newest at the bottom 🤦

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.

The code duplication makes me sad, but otherwise LGTM

var content_length;
var content_multiplier = 1;
// If the content is gzip encoded, try to get the uncompressed size.
if (response.headers.get('content-encoding') == 'gzip') {
Copy link
Member

Choose a reason for hiding this comment

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

why just gzip, and not compress, deflate, br`, etc?

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding

Copy link
Member Author

Choose a reason for hiding this comment

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

gzip is what gcloud happens to do. I'll add support for more encodings in the future:
#2452

@jleibs jleibs merged commit bbe8e1e into main Jun 15, 2023
@jleibs jleibs deleted the jleibs/loading_transitions branch June 15, 2023 15:34
emilk pushed a commit that referenced this pull request Jun 15, 2023
…wasm is loading (#2421)

Resolves:
 - #2261

According to the new design, here is how the loading state should work:
1. HTML and CSS loads. It renders the skeleton content without any text.
1. WASM loads. It renders the exact same skeleton content without any
text. The user doesn’t notice that the rendering method switched from
HTML => WASM.
1. If loading takes long (more than 3 seconds) text fades in and
provides additional information.
1. When the App UI is ready, the skeleton content fades away (200ms
duration) and the app fades in.

The first deployed test of this ended up with 300% progress during the
download step, so I've added some extra handling for progress related to
compressed streams.At the moment we default to an adhoc compression
ratio, but once we land:
 - #2422
 then the progress should be completely accurate again.

In order to make all the waiting variants more consistent, this also
changes the RRD loading page.

The normal waiting page looks like:

![image](https://github.com/rerun-io/rerun/assets/3312232/a8eb2473-7b7c-433a-a0b2-09c6d209c44e)

Before:

![image](https://github.com/rerun-io/rerun/assets/3312232/adcf27dc-5c59-4642-8fda-18d0de544442)

After:

![image](https://github.com/rerun-io/rerun/assets/3312232/cd4104db-be28-4c32-8171-2b9a9408cf23)

This PR does not handle progress indicator during the loading of the RRD
itself. The hooks necessary to get access to progress feedback depend on
essentially the same work already happening as part of:
#2412 and just directly loading
the rrd file is generally going to be better than showing a progress
indicator. It could be worth revisiting this for things like blueprints
with large static data.

This needs to be tested manually on our major OS / browser combinations:

Builds to test:
 - https://app.rerun.io/commit/e15ebb5
 - https://demo.rerun.io/commit/e15ebb5

If your internet connection is too fast, use developer tools to throttle
connection and enable cache.

![image](https://github.com/rerun-io/rerun/assets/3312232/8ba99668-5441-4652-b1f3-9c82c2b6cbb3)

- Linux:
  - [x] Chrome
  - [x] Firefox
- Mac:
  - [x] Chrome
  - [x] Firefox
  - [x] Safari
- Windows:
  - [x] Chrome
  - [x] Firefox
  - [x] Edge

* [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)

<!-- This line will get updated when the PR build summary job finishes.
-->
PR Build Summary: https://build.rerun.io/pr/2421

<!-- pr-link-docs:start -->
Docs preview: https://rerun.io/preview/934925b/docs
Examples preview: https://rerun.io/preview/934925b/examples
<!-- pr-link-docs:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕸️ web regarding running the viewer in a browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants