From bde6eb57f33aa3e14f2e69ad3d725bf09a97f543 Mon Sep 17 00:00:00 2001 From: Vikram Bhaskaran Date: Wed, 14 Oct 2026 02:20:07 +1100 Subject: [PATCH] UI: Spacebar previews the demo opened from the start screen (#1059) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reported flow — launch to the start screen, Open Demo Project, press Space — does not reproduce on main: the demo comp activates, the start screen closes, and playback starts. The behaviour already held (the #279 menu-focus and #204 start-screen work fixed the neighbouring bugs), so this lands as a regression test: space_previews_after_opening_the_demo_from_home walks the exact flow headlessly and asserts playing=true. cargo test -p effectcraft-ui-egui --test ui_menus: 8 passed. --- crates/ui-egui/tests/ui_menus.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/ui-egui/tests/ui_menus.rs b/crates/ui-egui/tests/ui_menus.rs index e198a619..ca4c8cab 100644 --- a/crates/ui-egui/tests/ui_menus.rs +++ b/crates/ui-egui/tests/ui_menus.rs @@ -225,3 +225,22 @@ fn import_dialog_offers_mxf() { assert!(offered.iter().any(|e| e == "mxf"), "offered {offered:?}"); assert!(offered.iter().any(|e| e == "mov")); } + +/// #1059: opening the demo from the start screen and immediately pressing Spacebar previews +/// the demo — the start screen's keyboard focus must not outlive it. +#[test] +fn space_previews_after_opening_the_demo_from_home() { + let mut h = { + let s = Session::default(); + let mut app = EffectcraftApp::new(s); + app.ui.start_screen = true; + Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_| app) + }; + h.run_steps(3); + let demo = rect(&h, "home.file.openDemoProject"); + click_at(&mut h, demo.center()); + assert!(h.state().session.active_comp().is_some(), "the demo comp is open"); + assert!(!h.state().ui.start_screen, "the start screen closed"); + key(&mut h, Key::Space); + assert!(h.state().playback.playing, "Space previews the demo (#1059)"); +}