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

Introduce a welcome screen when no recording is loaded #2982

Merged
merged 24 commits into from
Aug 17, 2023

Conversation

abey79
Copy link
Member

@abey79 abey79 commented Aug 15, 2023

What

This adds a MVP Welcome Screen that shows up instead of the current "Loading" screen in certain circumstances.

In general terms:

  • The Welcome Screen is drawn in the Viewport's place, ie. with the panels visible.
  • The Welcome Screen is never displayed when a recording is available.
  • The current implementation of the Welcome Screen is very basic—mostly links to webpages.
  • The current "loading screen" still exists and is "sometimes" displayed.

The tricky thing is when to show the Welcome Screen vs. the legacy loading screen. This PR includes an heuristic (implemented in App::handle_default_blueprint()). The main determinant is the nature of the receiver (file, tcp, web socket, etc.) which we use as a proxy for the workflow in which the viewer is being used. The TCP receiver is a bit tricky, as it's used by both the Python SDK (we don't want the Welcome Screen to distractingly flash at spawn, before data arrives) and when running manually ($ rerun). To address this, this PR introduces a new --skip-welcome-screen CLI option, used by the Python SDK. This situation is still not entirely perfect though: #3018.

Implementation details:

  • Technically, the Welcome Screen is triggered when the app ID is set to StoreHub::welcome_screen_app_id(). A corresponding blank blueprint is created at startup (by StoreHub) to make the UI happy. App::handle_default_blueprint() basically sets that app ID to trigger the Welcome Screen.
  • Likewise, an empty recording is always set as active whenever the app ID is set but no recording is available. This empty recording isn't in the list of available recordings (ViewerContext::alternate_recordings). This make the UI happy.
  • The status string and source originally displayed in the legacy loading screen are also displayed on the Welcome Screen in some circumstances (i.e for "infinite" data sources, tcp, ws, etc.)

Expect these follow-up PRs:

Fixes #2513

image

Checklist

@abey79 abey79 added the ui concerns graphical user interface label Aug 15, 2023
@nikolausWest
Copy link
Member

??? what's the acceptable minimum that the "Add View" button can do?

Could you highlight (or even also virtually click) the "+" button in the blueprint view?

@abey79
Copy link
Member Author

abey79 commented Aug 15, 2023

Could you highlight (or even also virtually click) the "+" button in the blueprint view?

I'll experiment with that.

@abey79
Copy link
Member Author

abey79 commented Aug 16, 2023

@nikolausWest bad news, the "add blueprint" button is empty when the recording is empty:

image

(that circle there is an empty popup when clicking the + icon)

I'll check how bad it would be to have something in there, but not liking how that might drag this PR too far.

@abey79
Copy link
Member Author

abey79 commented Aug 16, 2023

Actually, that was easy enough to hack:

image

abey79 added 3 commits August 16, 2023 11:09
- use empty recording if none is open
- keep current blueprint id when closing all recordings
- offer every types of blueprints when recording is empty
# Conflicts:
#	crates/re_viewer/src/app.rs
#	crates/re_viewer/src/store_hub.rs
@abey79
Copy link
Member Author

abey79 commented Aug 16, 2023

Next challenge is around that empty blueprint being edited. We'll need to set an associated app ID which means more UI. More generally, I'm still struggling to see how this would result in a meaningful workflow in the short term 🤔

abey79 added 8 commits August 16, 2023 15:35
…ewport. The old loading ui is used when no blueprint is available.
- added --skip-welcome-screen
- store hub inited with a "welcome screen" blueprint (for use as marker to show welcome screen)
- welcome screen shown only if app_id is <welcome screen>
@abey79 abey79 changed the title (WIP) Onboarding welcome screen MVP Introduce a welcome screen when no recording is loaded Aug 17, 2023
@abey79 abey79 marked this pull request as ready for review August 17, 2023 07:32
@emilk emilk self-requested a review August 17, 2023 07:33
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.

It looks great! I haven't tested it on web yet though

crates/re_ui/data/images/welcome_screen_configure.jpg Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/wait_screen_ui.rs Show resolved Hide resolved
ui.label(
egui::RichText::new(
"Open and visualize recorded data from previous Rerun sessions (.rrd) as well \
as data in formats like .gltf and .jpg.",
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit confusing right now - the "Open file" dialog and file drag-dropping only supports .rrd files atm, thought that should be fairly easy to fix:

Copy link
Member Author

Choose a reason for hiding this comment

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

Added to my short term todo

crates/re_ui/src/icons.rs Show resolved Hide resolved
@@ -54,6 +54,11 @@ pub const RESET: Icon = Icon::new("reset", include_bytes!("../data/icons/reset.p

pub const CLOSE: Icon = Icon::new("close", include_bytes!("../data/icons/close.png"));

pub const EXTERNAL_LINK: Icon = Icon::new(
Copy link
Member

Choose a reason for hiding this comment

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

We should use this icon on the "Help" button in the rerun menu too, and maybe elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

Noted, will do a follow-up PR

crates/re_viewer/src/ui/wait_screen_ui.rs Show resolved Hide resolved
crates/re_viewer/src/ui/wait_screen_ui.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/wait_screen_ui.rs Outdated Show resolved Hide resolved
crates/re_viewer/src/ui/wait_screen_ui.rs Outdated Show resolved Hide resolved
@@ -98,6 +98,10 @@ struct Args {
#[clap(long)]
screenshot_to: Option<std::path::PathBuf>,

/// Do not display the welcome screen.
#[clap(long)]
skip_welcome_screen: bool,
Copy link
Member

Choose a reason for hiding this comment

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

This is never used?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I (prematurely?) added it thinking that it would be needed to avoid the welcome screen temporarily showing up in this situation:

rr.init("delay", spawn=True)
time.sleep(5)
rr.log_points("points", np.random.rand(10, 2))

However, rr.init() itself sends stuff (at least the app ID, etc.) which gets us directly into the "active blueprint and recording" state. So for this scenario, this --skip-welcome-screen is not needed. I assume it will be the same for the C++ SDK. Rust uses the Sdk channel, which skips the welcome screen until the recording is closed, so that's ok.

Beyond the web demo, I haven't tested all other scenarios yet though—I wouldn't even be capable to list them tbh. But I don't really expect we have an immediate need for that flag yet. I can think of future scenarios where this could come handy(e.g. long running server where advanced users don't want to see "that annoying screen"), but I'm totally fine removing it for the time being.

👍🏻👎🏻❓

Copy link
Member Author

Choose a reason for hiding this comment

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

Never mind the above 🦆

The Python SDKs really want that --skip-welcome_screen. I can easily see it by adding delays in the spawn() function. So it means that on a slow computer, or due to future change, that welcome screen could temporarily "flash" before data is displayed, which is far worse than the loading screen. So I'll use that flag in the python SDK (and C++ if I can figure out how).

@abey79 abey79 merged commit ce6829b into main Aug 17, 2023
@abey79 abey79 deleted the antoine/welcome-screen-v0 branch August 17, 2023 12:23
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 this pull request may close these issues.

Display help content on the empty screen after startup
3 participants