UI: Spacebar previews the demo opened from the start screen (#1059)

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.
This commit is contained in:
Vikram Bhaskaran
2026-10-14 02:20:07 +11:00
parent 549e9d8251
commit bde6eb57f3
+19
View File
@@ -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)");
}