Skip to content

Conversation

@kaascevich
Copy link
Contributor

AlertScene is a scene that presents a whole-app modal alert (or the backend's closest approximation thereof). It behaves similarly to View.alert(_:isPresented:actions:), but isn't attached to any one window.

An empty block returns the default "OK" action. `AlertScene` and `presentAlert` now require the `actions` parameter; an empty closure provides the previous behavior.
Copy link
Collaborator

@stackotter stackotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be handy to have around. I've requested a few changes, but for the most part you've implemented it very well 🙏

stackotter
stackotter previously approved these changes Jan 5, 2026
@stackotter
Copy link
Collaborator

Just did some local testing.

It works with AppKitBackend, and GtkBackend.

It crashes with UIKitBackend;

UIKitBackend/UIKitBackend+Alert.swift:42: Fatal error: Could not find window in which to display alert

WindowingExample crashes with Gtk3Backend for an unrelated reason (#308); now resolved by your #309 PR.

WindowingExample crashes with WinUIBackend as soon as the windows appear, but I'm not sure why. I'm currently looking into whether it's related or not, but I'm having issues with my Windows VM.

@kaascevich kaascevich requested a review from stackotter January 7, 2026 16:57
Copy link
Collaborator

@stackotter stackotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I'll test locally and then merge if all goes well

@stackotter
Copy link
Collaborator

Tested with all backends and all works well

@stackotter stackotter merged commit 5886503 into moreSwift:main Jan 9, 2026
11 checks passed
@kaascevich kaascevich deleted the alert-scene branch January 9, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants