Skip to content

Canvas Panel — WebView2-based canvas viewer in tray app #5

Closed

Description

@shanselman

Summary

Add a Canvas panel to the tray app using WebView2, similar to the existing WebChat panel. This would let Clawdbot's canvas output (HTML renders, visualizations, interactive content) display directly in the Windows companion app without needing a browser.

Background

The WebChat panel (already implemented) proves WebView2 works well as an embedded viewer. Canvas is Clawdbot's feature for rendering rich HTML content — things like data visualizations, interactive tools, status dashboards, or any UI the agent builds on the fly.

Implementation Ideas

  • Add a new CanvasPanel form/control with an embedded WebView2 instance
  • Subscribe to canvas events from the gateway (similar to how WebChat subscribes to messages)
  • Navigate the WebView2 to the canvas URL when content is presented
  • Support multiple canvas instances or tab-like switching if multiple canvases are active
  • Consider a menu item or hotkey to toggle the canvas panel visibility
  • Could share WebView2 environment/profile with the existing WebChat panel to reduce resource usage

Acceptance Criteria

  • Canvas panel opens from tray menu or system event
  • Renders Clawdbot canvas HTML content correctly
  • Updates when new canvas content is pushed
  • Can be shown/hidden independently from WebChat
  • Doesn't leak GDI handles or WebView2 processes on close

Activity

  1. shanselman commented on Feb 8, 2026

    @shanselman
    CollaboratorAuthor

    Canvas is fully implemented and working end-to-end. All 7 canvas commands are wired up:

    • canvas.present — Opens WebView2 window with URL/HTML, supports sizing, positioning, always-on-top
    • canvas.hide — Closes canvas window
    • canvas.navigate — Changes canvas URL
    • canvas.eval — Executes JavaScript in WebView2, returns results
    • canvas.snapshot — Captures canvas as base64 PNG/JPEG
    • canvas.a2ui.push — Pushes A2UI JSONL messages
    • canvas.a2ui.reset — Resets A2UI state

    Security hardened with URL validation (blocks dangerous schemes, private IPs) and HTML sanitization (strips iframe/object/embed/applet).

    Key files:

    • \src/OpenClaw.Shared/Capabilities/CanvasCapability.cs\ — Command parsing + events
    • \src/OpenClaw.Tray.WinUI/Windows/CanvasWindow.xaml.cs\ — WebView2 viewer
    • \src/OpenClaw.Tray.WinUI/Services/NodeService.cs\ — Event wiring

    Shipped in v0.4.0.

  2. added a commit that references this issue on Apr 20, 2026
  3. locked as resolved and limited conversation to collaborators on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions