-
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
Web viewer navigation (back-button) #5398
Comments
For the simple case here, would we drop the recording if you click and example on the welcome page, wait for recording to load, press back? |
As a first step, we should handle only navigations between the example page and recordings:
This may introduce weird edge cases, but we're okay with that, because we just want the happy path of onboarding to work. |
This is "high" urgency if it's a quick fix. Otherwise it's "medium" |
Sounds like a good plan |
We can also use the strategy of egui.rs and add |
It seems like the best course of action would be to use the history API, as Jan suggested. When leaving the examples/welcome page (clicking an example) we can call both: history.pushState({}, "", "?examples");
history.pushState({}, "", "?url=…"); Then when the user hits the back-button, they will end up at We would need to install an even handler to listen for these changes with window.addEventListener('popstate', function(event) {
…
}) |
### What * Closes #5398 This uses the [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API) to manipulate the web history. When leaving the example page, two entries in the history are added: * `?examples` (shows the examples) * `?url=https://….rrd` (the url for the example) This is then parsed on `popstate`. We thus support both going forward and back in history. This is not perfect, but a lot better than before. Best reviewed commit by commit. ### 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: [rerun.io/viewer](https://rerun.io/viewer/pr/5750) * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/5750?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/5750?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/5750) - [Docs preview](https://rerun.io/preview/d308ce076b28481d77fac64217df69a452cc54a9/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/d308ce076b28481d77fac64217df69a452cc54a9/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) --------- Co-authored-by: Jeremy Leibs <[email protected]>
We currently don't handle back/forward navigations in any way.
In practice, this means that:
This puts them back to where they were in the browser before navigation to app.rerun.io. That's quite a jarring experience.
The back button in the scenario above should've taken the user to the welcome screen, with the scroll position restored from before they opened the example. They may then either:
We should implement a navigation history within the viewer, mirroring the web history API.
What exactly requires an entry in the navigation history is somewhat unclear. We can start with only keeping track of navigations between the welcome screen and a recording, and between individual recordings when multiple are open at the same time.
We may eventually want to expand what we keep track of in the navigation history to more than just the welcome screen and recordings. For example, in Slack, clicking on "replies" under a post thread will "split" the main content area into the channel and reply thread (as long as there is enough space for both), where navigating back will close the thread, and subsequently navigating forward will re-open the thread.
The text was updated successfully, but these errors were encountered: