ReviewOS

also looking at this

craft-native/craft

feat: add Linux and Windows named-window routing

#325
Merged glennmichael123 wants to merge codex/multi-window-linux-windows into main
29 files +2250 -200

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

docs/PLATFORMS.mdmodified+5-3
Changes to docs/PLATFORMS.md
@@ -155,7 +155,8 @@ Currently implemented foundations (experimental):
155155- �� Notifications, tray, clipboard, and dialogs require further integration testing
156156- ✅ Hot reload via WebSocket
157157- ✅ Developer tools (WebKit Inspector)
158- �� Multi-window, bridge parity, and advanced window behavior are incomplete
158- ✅ Named runtime windows, addressed controls, and scoped window events (GUI smoke in CI)
159- �� Other bridge parity and advanced window behavior remain incomplete
159160
160161### Known Limitations
161162
@@ -247,11 +248,12 @@ Currently implemented foundations (experimental):
247248- �� Notifications, tray, clipboard, and dialogs require further integration testing
248249- ✅ Hot reload via WebSocket
249250- ✅ Developer tools (Edge DevTools)
250- �� Multi-window, bridge parity, and advanced window behavior are incomplete
251- ✅ Named runtime windows, addressed controls, and scoped window events (WebView2 GUI smoke in CI)
252- �� Other bridge parity and advanced window behavior remain incomplete
251253
252254### Known Limitations
253255
254- **WebView2 Required**: End users must have WebView2 Runtime installed
256- **WebView2 Required**: End users must have WebView2 Runtime installed; release archives include the app-local loader DLL
255257- **Transparency**: Requires DWM (Desktop Window Manager) enabled
256258- **System Tray**: Icon must be .ico format
257259- **UWP Apps**: Limited support for UWP features
docs/architecture/multi-window-ownership.mdmodified+4-3
Changes to docs/architecture/multi-window-ownership.md
@@ -18,9 +18,10 @@ whether it stores a window-specific target.
1818| Permanent destroy and cleanup | Implemented for named windows | Implemented on close/destroy | Implemented on close/destroy |
1919| Modal and parent relationships | Unspecified | Unspecified | Unspecified |
2020
21Issue #67 remains open while the full CI matrix and the still-unspecified
22modal/parent semantics are reviewed. The Windows release archive now stages an
23app-local WebView2 loader; users still need the Microsoft WebView2 Runtime.
21The runtime-creation, stable-handle, reply-routing, and event-scoping contract
22from issue #67 is covered here. Modal/parent semantics remain separate future
23decisions. The Windows release archive stages an app-local WebView2 loader;
24users still need the Microsoft WebView2 Runtime.
2425
2526Linux and Windows keep their live native window/webview pairs in
2627`desktop_window_registry.zig`. Page messages are authenticated by the sending
docs/features/window-management.mdmodified+3-2
Changes to docs/features/window-management.md
@@ -485,8 +485,9 @@ restore its DOM and JavaScript state. On Linux and Windows, closing releases
485485the native window and webview; reopening the same ID creates a fresh page
486486behind the same stable SDK handle. Call `destroy()` to permanently release a
487487runtime-created window and its event subscriptions. The unnamed primary window
488cannot be force-destroyed through this API. CI exercises the Linux
489create/close/reopen path under Xvfb.
488cannot be force-destroyed through this API. CI exercises Linux
489create/close/reopen under Xvfb and the equivalent Windows WebView2 path,
490including concurrent child creation and stale-handle cleanup.
490491Modal/parent semantics are not part of the runtime-created-window contract yet.
491492See [Multi-window ownership](../architecture/multi-window-ownership.md) for the
492493implemented routing guarantees, application-level event sinks and remaining
docs/usage.mdmodified+7-6
Changes to docs/usage.md
@@ -330,15 +330,16 @@ await settingsWindow.focus()
330330```
331331
332332Calling `createWindow` again with the same `id` brings the retained native
333window forward and returns the same typed handle. Runtime creation currently
334uses the macOS host. `close()` retains that page for a later reopen, while
335`destroy()` permanently releases a runtime-created window; the unnamed primary
336window is not destroyable through this API. Modal and parent-window
337relationships are not supported.
333window forward and returns the same typed handle on macOS, Linux, and Windows.
334On macOS, `close()` retains the page for a later reopen. On Linux and Windows,
335closing releases the native page; reopening the same ID creates a fresh one
336behind the stable typed handle. `destroy()` permanently releases a
337runtime-created window; the unnamed primary window is not destroyable through
338this API. Modal and parent-window relationships are not supported.
338339
339340The [multi-window ownership contract](architecture/multi-window-ownership.md)
340341tracks which state is window-scoped, which events intentionally target the
341primary page and what remains before the feature is cross-platform.
342primary page, and which advanced behaviors remain outside the contract.
342343
343344### Window Lifecycle Events
344345