Skip to content

Add system webview element - #151

Open
espetro wants to merge 3 commits into
remorses:mainfrom
espetro:gpuix-webview
Open

espetro wants to merge 3 commits into
remorses:mainfrom
espetro:gpuix-webview

Conversation

@espetro

@espetro espetro commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a built-in <webview> element backed by wry's OS webview integration: WKWebView on macOS and WebView2 on Windows.
  • Keep the native child aligned with the GPUI-painted layout box during paint, including resize and layout movement.
  • Support URL and inline HTML loading, navigation lifecycle events, document title events, navigation notifications, IPC messages, and one-shot reload/back/forward/evaluateScript commands.
  • Expose matching React and Solid JSX types, document the API and overlay limitations, and add examples/webview.tsx as a browser-chrome skeleton.

Validation

  • cargo check --lib in packages/native
  • node ../../node_modules/typescript/bin/tsc -p tsconfig.json in packages/native
  • bun run build in packages/react
  • bun run build in packages/solid

Platform scope and limitations

macOS and Windows only in this PR. Linux needs a deliberate GTK/wry integration story because GPUI does not provide a GTK widget hierarchy. The webview is a native overlay rather than GPU-rendered content, so it follows layout but does not participate in GPU clipping, opacity, transforms, screenshots, text selection, or GPUI z-order.

Suggested .rules additions

None.

Release Notes:

  • Added a system webview element for embedding WKWebView or WebView2 content inside GPUIX apps

window_content_size uses napi types that only exist in desktop builds, so keep
it out of wasm32 compilation. Also avoid importing the desktop event bridge in
unsupported webview builds.
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