Skip to content

Add layered WebView stack support#28

Merged
ctate merged 22 commits into
mainfrom
ctate/multi-webview
May 13, 2026
Merged

Add layered WebView stack support#28
ctate merged 22 commits into
mainfrom
ctate/multi-webview

Conversation

@ctate
Copy link
Copy Markdown
Collaborator

@ctate ctate commented May 12, 2026

Summary

  • Replace the overlay-specific bridge API with named layered WebViews via zero-native.webview.*, including list, setLayer, layer, transparent, and per-WebView bridge mode.
  • Treat the startup app surface as the default trusted main WebView and extend runtime/platform/native backends to manage WebViews as a stack inside each native window.
  • Refactor the browser example, docs, app manifests, TypeScript declarations, and smoke scripts around the multiple WebViews model.

Notes

  • Linux CEF still explicitly fails child WebView creation until real native CEF embedding is wired in.
  • Manual automation smoke was attempted, but the automation CLI reported no connected app in this environment.

Expose built-in overlay bridge commands so apps can render isolated native webviews above an existing window without injecting the app bridge into untrusted content.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zero-native Ready Ready Preview, Comment May 13, 2026 2:37pm

Comment thread src/platform/root.zig Outdated
Expose overlay WebViews through the typed JS API, docs, examples, and runtime validation while wiring the native platform services so the feature behaves consistently across backends.
Comment thread src/platform/root.zig Outdated
return null;
}

fn removeOverlayAt(self: *NullPlatform, index: usize) void {
Copy link
Copy Markdown

@vercel vercel Bot May 12, 2026

Choose a reason for hiding this comment

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

After removing an overlay and shifting remaining overlays down, the label and url slices in shifted NullOverlay structs point into the wrong struct's inline label_storage/url_storage arrays, creating dangling/aliased pointers.

Fix on Vercel

Tighten overlay validation, backend behavior, and documentation so overlay WebViews behave consistently across supported hosts. Add a vanilla no-build browser example that uses overlay WebViews for page content.
Default windowId to the calling window instead of hardcoding 1,
cap overlay slots globally, document backend support matrix, and
polish the browser example with tab management and keyboard nav.
Comment thread src/platform/macos/cef_host.mm Outdated
Replace the overlay-specific API with named layered WebViews so trusted app chrome and isolated page content can compose cleanly in one native window.
@ctate ctate changed the title Add native overlay webview support Add layered WebView stack support May 12, 2026
Remove legacy overlay naming from the WebView stack internals and public examples so the branch consistently presents the layered WebView model.
Reject unsupported backend paths with actionable errors and make child WebView bridge exposure match the documented trust model.
Tighten backend error handling and WebView metadata so layered WebViews behave predictably across supported hosts.
Preserve shifted WebView labels and URLs after close so NullPlatform state stays consistent during lifecycle tests.
Ensure AppKit menu actions resolve the key window's registered WebView after layered WebView containers replaced the direct content view.
Guard WebView2 async callbacks during teardown and make macOS CEF layer changes reorder real peer views so layered WebViews match the advertised stack model.
Keep runtime WebView state aligned with native lifecycle failures and make macOS layered WebView close/recreate behavior match the advertised stack model.
@ctate ctate merged commit e05e188 into main May 13, 2026
14 checks passed
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.

1 participant