canvas-preview
The "native, web, or both per window" proof: one window hosting a Native SDK canvas (Metal-backed toolbar + sidebar rendered by the widget engine) and a live platform webview side by side.
- The webview is an ordinary scene shell view (
kind = .webview, parented to the canvas view). The build's web engine backs it: WKWebView with-Dweb-engine=system(default), bundled Chromium with-Dweb-engine=cef— the pane seam below is engine-agnostic, though gpu_surface canvases currently require the system engine on macOS. UiApp.Options.web_paneskeeps the webview snapped to a canvas widget's layout frame — the empty panel carrying thepreview-panesemantics label — through install, rebuilds, and resizes.- The model owns
url+reload_token(the CenterPane/Preview-tab consumer shape): switching pages navigates, bumping the token reloads. UiApp.Options.status_iteminstalls a menu-bar extra (macOSNSStatusItem) whose menu items dispatch the sameon_commandcommands as the toolbar buttons.
Run it:
native dev
Automation smoke (from the repo root):
zig build test-canvas-preview-smoke
Headless tests:
native test