From 3d0cad331281194906b315ebaf04e2c231dcbe6f Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Sun, 15 Nov 2026 23:50:02 +0100 Subject: [PATCH] app: open the review once the history has loaded `--scene review --live` opened the screen before the timelines were read and stayed on "No game selected". The screen now remembers the request and opens the first game that has events when the list arrives. --- app/src/app.rs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/src/app.rs b/app/src/app.rs index 8c02e83..8468658 100644 --- a/app/src/app.rs +++ b/app/src/app.rs @@ -120,6 +120,7 @@ pub struct App { pub notice: Option, pub autostart: bool, pub logs: String, + pub pending_review: bool, pub last_status: f64, pub tray_events: Option>, pub tray: Option, @@ -155,6 +156,7 @@ impl App { notice: None, autostart, logs: String::new(), + pending_review: false, last_status: -10.0, tray_events: None, tray: None, @@ -448,6 +450,9 @@ impl App { self.games_loaded = true; self.games_rx = None; changed = true; + if self.pending_review { + demo_review(self); + } } Err(TryRecvError::Empty) => {} Err(TryRecvError::Disconnected) => self.games_rx = None, @@ -730,6 +735,22 @@ pub fn headless() -> bool { /// Put the first sample game on the review screen, for `--scene review`. pub fn demo_review(app: &mut App) { app.screen = Screen::Review; + if app.games.is_empty() { + // Opened before the history finished loading: `poll` opens it once it has. + app.pending_review = true; + return; + } + app.pending_review = false; + let live = std::env::args().any(|arg| arg == "--live"); + if live { + let index = app + .games + .iter() + .position(|game| !game.events.is_empty()) + .unwrap_or(0); + screens::review::open(app, index); + return; + } app.review.game = app.games.first().map(|game| game.recording_id.clone()); app.review.error = Some("Sample recording: no clip on disk.".to_string()); if let Some(game) = app.games.first() {