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

Show Welcome Screen after closing recording even with --skip-welcome-screen #3035

Merged
merged 4 commits into from
Aug 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ pub struct App {
/// Interface for all recordings and blueprints
pub(crate) store_hub: Option<StoreHub>,

/// Was a recording ever loaded? Used by the heuristic controlling the welcome screen.
recording_seen: bool,
abey79 marked this conversation as resolved.
Show resolved Hide resolved

/// Toast notifications.
toasts: toasts::Toasts,

Expand Down Expand Up @@ -210,6 +213,8 @@ impl App {

style_panel_open: false,

recording_seen: false,

latest_queue_interest: web_time::Instant::now(), // TODO(emilk): `Instant::MIN` when we have our own `Instant` that supports it.

frame_time_history: egui::util::History::new(1..100, 0.5),
Expand Down Expand Up @@ -582,6 +587,7 @@ impl App {
// (StoreContext::alternate_recordings), which means that it's not displayed in
// the recordings UI.
let store_db = if let Some(store_db) = store_view.recording {
self.recording_seen = true;
store_db
} else {
&EMPTY_STORE_DB
Expand Down Expand Up @@ -840,13 +846,19 @@ impl App {
/// loaded). This function implements the heuristic which determines when the welcome screen
/// should show up.
fn handle_default_blueprint(&mut self, store_hub: &mut StoreHub) {
if store_hub.current_recording().is_some()
|| store_hub.selected_application_id().is_some()
|| self.startup_options.skip_welcome_screen
// Don't show the welcome screen if we have actual data to display.
if store_hub.current_recording().is_some() || store_hub.selected_application_id().is_some()
{
return;
}

// Don't show the welcome screen if the `--skip-welcome-screen` flag was used (e.g. by the
// Python SDK), until some data has been loaded and shown. This way, we *still* show the
// welcome screen when the user closes all recordings after, e.g., running a Python example.
if self.startup_options.skip_welcome_screen && !self.recording_seen {
return;
}

abey79 marked this conversation as resolved.
Show resolved Hide resolved
// Here, we use the type of Receiver as a proxy for which kind of workflow the viewer is
// being used in.
let welcome = match self.rx.source() {
Expand Down