Skip to content

Current and previous page renders for a split second when using ui.push_screen("...") #282

Description

@marceloadsj

Description

For a very short period, when you use ui.push_screen("..."), both pages are rendered at the same time.

Steps to Reproduce

  • run the code below
  • hit enter to trigger the btn "Settings"
  • Bug: you should see the new page (settings) render below the current page (home)
use slt::ScreenState;

fn main() -> std::io::Result<()> {
    let mut screens = ScreenState::new("home");

    slt::run(|ui| {
        ui.screen("home", &mut screens, |ui| {
            if ui.button("Settings").clicked {
                ui.push_screen("settings");
            }
        });
        ui.screen("settings", &mut screens, |ui| {
            if ui.button("Back").clicked {
                ui.pop_screen();
            }
        });
    })
}

Expected Behavior

The old page to disappear right before the new page is rendered. As in, only 1 page at a time.

Actual Behavior

example_bug_screen_push.mov

PS: It also happens on a standalone terminal, outside of the IDE.

Environment

SLT version: 0.22.0
Rust version: rustc 1.98.0-nightly (1f087276b 2026-06-13)
OS: macos 26.4
Terminal: zsh
Features enabled: none

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions