Skip to content

desktop: WebGPU preview broken in Electrobun BrowserWindow (needs GpuWindow/<wgpu> bridge) #143

Description

@RichardBray

Sub-issue of #133. Blocks #137 wiring and #140 native preview - discovered while testing #136 shell locally.

Bug

File selection works fine (picker opens, onFile fires, object URL created). But the effects preview silently never renders. Root cause: packages/ui/app/gpu/renderer.ts:145 calls navigator.gpu.requestAdapter() directly. In a plain browser tab this works. In Electrobun's plain BrowserWindow (what packages/desktop/src/bun/index.ts currently uses) navigator.gpu is not exposed - Electrobun only surfaces its native Dawn WebGPU implementation via a separate GpuWindow/<wgpu> custom element + RPC bridge (node_modules/electrobun/dist/api/bun/core/GpuWindow.ts, .../dist/api/browser/wgputag.ts), not the standard web API on ordinary page content.

Symptom: for images, Canvas.tsx's init().catch() sets previewError but the error card is gated to !isVideo so nothing shows. For video, firstFrameReady never gets set - stuck on "Loading preview..." forever (App.tsx:420,443). Reads as "nothing happens" when selecting a file.

Fix options (need real GUI verification, not done blind)

  • Switch the desktop window to Electrobun's GpuWindow/ integration instead of plain BrowserWindow.
  • Or check if Electrobun's WKWebView shell supports enabling standard WebGPU via a flag/entitlement (less likely given the native-bridge design).

Files

packages/ui/app/gpu/renderer.ts:143-151, packages/ui/app/components/Canvas.tsx, packages/desktop/src/bun/index.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — soon, not urgent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions