Skip to content

FreeStandingAlerts.md

Noah Gibbs edited this page Dec 19, 2023 · 1 revision

Free-Standing Alerts

Alerts behaved pretty differently in Shoes3. For instance, you could have an app that just popped up an alert and nothing else - just that single line. That's more profound than it sounds.

Right now in Scarpe, we don't run any code after the Shoes.app block because once we hit Webview run, we're not running your Ruby code any more. But also in Scarpe the Webview window can only exist while your code is running. Also we add alerts as divs inside the DocumentRoot, so if there's no DocumentRoot you can't see your alerts anyway.

So for free-standing alerts, we pretty much need a Display Server. They need to open a new window, and that window needs to persist after the process dies.

If we run the app code inside a Fiber that can get us partway there... But only partway. We still need a Shoes.app to even have a window for the alerts, though maybe we could open a window when alerts happen, and only fully populate it later? We still can't have them persist after the process dies, though we could have the process refuse to die until all its windows are closed. Basically, treat the window less like a Shoes.app and more like a display surface that can have one or more Shoes.apps that display to it.

They'd all have to fit in a single little rectangular box, of course, same as now.