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+6-0
Changes to docs/PLATFORMS.md
@@ -158,6 +158,9 @@ Currently implemented foundations (experimental):
158158- ✅ Named runtime windows, addressed controls, and scoped window events (GUI smoke in CI)
159159- �� Other bridge parity and advanced window behavior remain incomplete
160160
161The Xvfb smoke covers named create, addressed replies, close, and reopen; it
162does not establish full desktop bridge parity for a particular application.
163
161164### Known Limitations
162165
163166- **Transparency**: Requires compositor (e.g., Picom, Compton)
@@ -251,6 +254,9 @@ Currently implemented foundations (experimental):
251254- ✅ Named runtime windows, addressed controls, and scoped window events (WebView2 GUI smoke in CI)
252255- �� Other bridge parity and advanced window behavior remain incomplete
253256
257The native WebView2 smoke also exercises concurrent child creation and cleanup;
258it does not establish full desktop bridge parity for a particular application.
259
254260### Known Limitations
255261
256262- **WebView2 Required**: End users must have WebView2 Runtime installed; release archives include the app-local loader DLL
docs/architecture/multi-window-ownership.mdmodified+10-7
Changes to docs/architecture/multi-window-ownership.md
@@ -75,9 +75,10 @@ back to whichever window was created most recently:
7575- The local scroll monitor is installed once, but reads the event's `NSWindow`,
7676 advances only that window's accumulator and emits only to its webview.
7777
78`close()` preserves these resources and the SDK's native-event subscriptions
79so the same page can reopen with its DOM and JavaScript state intact, including
80when the primary window is reopened by the Dock rather than `createWindow()`.
78On macOS, `close()` preserves these resources and the SDK's native-event
79subscriptions so the same page can reopen with its DOM and JavaScript state
80intact, including when the primary window is reopened by the Dock rather than
81`createWindow()`.
8182`destroy()` removes the named registry entry, Native UI graph, gesture and
8283material slots, recovery state, event ownership and retained AppKit objects
8384before releasing the window and detaching the SDK's DOM listeners.
@@ -139,9 +140,9 @@ The next multi-window milestone needs product decisions in addition to code:
1391404. Finish advanced Linux/Windows window actions and clarify which are portable
140141 versus platform-specific, without conflating close semantics: macOS retains
141142 a closed page, while Linux and Windows release it.
1425. Complete platform-native integration coverage. Linux WebKitGTK runs under
143 Xvfb in CI; Windows currently has a cross-build but still needs a real
144 WebView2 lifecycle smoke on a capable Windows runner.
1435. Expand platform-native integration beyond the current named-window lifecycle
144 smokes. CI runs Linux WebKitGTK under Xvfb and Windows WebView2 on a native
145 runner, but advanced actions and packaged-app behavior still need coverage.
145146
146147## Review checklist
147148
@@ -151,6 +152,8 @@ For every new bridge or callback that touches a window, verify:
151152- An explicit window ID is resolved through the registry and unknown IDs fail.
152153- An asynchronous reply retains both its target and its requesting webview.
153154- A delayed control callback stores its owner on the control/delegate instance.
154- Ordinary close preserves state; permanent destroy forgets it exactly once.
155- On macOS, ordinary close retains the page and permanent destroy forgets it
156 exactly once. On Linux and Windows, close and destroy both release the native
157 window/webview; a later open of the same name creates a fresh native page.
155158- A process-global event sink is documented as primary, broadcast or
156159 subscriber-owned rather than inheriting accidental last-window behavior.
docs/features/window-management.mdmodified+4-3
Changes to docs/features/window-management.md
@@ -483,9 +483,10 @@ by `on`, such as `stopWatching()` above, when the listener is no longer needed.
483483On macOS, closing a window keeps its native page alive so reopening can
484484restore its DOM and JavaScript state. On Linux and Windows, closing releases
485485the native window and webview; reopening the same ID creates a fresh page
486behind the same stable SDK handle. Call `destroy()` to permanently release a
487runtime-created window and its event subscriptions. The unnamed primary window
488cannot be force-destroyed through this API. CI exercises Linux
486behind the same stable SDK handle. `destroy()` releases a named window's native
487resources and detaches its SDK DOM listeners. A later `createWindow()` with the
488same ID reuses the typed handle and reattaches those listeners. The unnamed
489primary window cannot be force-destroyed through this API. CI exercises Linux
489490create/close/reopen under Xvfb and the equivalent Windows WebView2 path,
490491including concurrent child creation and stale-handle cleanup.
491492Modal/parent semantics are not part of the runtime-created-window contract yet.