[FEATURE] Mods: a pane element that renders a local web page (WebView), no server needed
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
Mod panes (function-hooks plugins, $.ui.open + ui.render) can't show a web page. The desktop element table is Box, Text, Button, Input, Select, Svg, Link, Code, Markdown and Client: Svg is script-less and Client is cell-based. So any UI that needs real web features (a canvas, image display, drag and drop) can't live in the mod's own pane. Today the workaround is to have the mod start a local HTTP server and open the page in the browser pane, which means writing and running a server just to show a page.
Proposed Solution
A built-in pane element that renders a page from the plugin's own folder, e.g. WebView({ source: './ui/index.html' }): sandboxed, no server needed, and talking to the hooks module by messages (like Client posts). Mod UIs could then be built with ordinary web tooling (TypeScript with React, Angular, Svelte ...) instead of composing pane elements.
Alternative Solutions
- Start a local server from the mod (
$.process.spawn) and open it in the browser pane. Works, but needs a server, and a mod can't open the browser pane on its own in auto mode (separate issue), so Claude has to be asked to do it. - Svg with an embedded picture: no scripts, 128 KB limit, so no interaction.
Priority
Medium - Would be very helpful
Feature Category
Developer tools/SDK
Use Case Example
A picture-review mod for flashcard images: the user looks at each generated picture, marks it ok/off, draws red marks on what is wrong, and sends a batch; the mod turns the batch into a turn for Claude ($.prompt.submit), which fixes the marked pictures. The event part works great; the drawing UI needs a canvas, so it has to run in a separate local server shown in the browser pane.
Additional Context
Claude Code 2.1.286, desktop app, Windows.
3 Comments
One more thought on how this could work out of the box: Claude Code already compiles a mod's
register.tsx(JSX + TypeScript) with no build step on the author's side. The same could apply to the web view: a mod ships aui/folder (e.g.ui/App.tsxwith React, Vue or Svelte and its npm dependencies), and Claude Code bundles it (Vite or its own bundler) and hot-reloads it on save, the way it reloads the hooks module today. Then a pane UI is written like any frontend app, with no separate build tooling or local server.The open question is dependencies: either Claude Code installs them, or the mod commits a pre-built
dist/that the pane loads as-is (works without tooling, but needs a rebuild after edits). Supporting both would cover simple and larger UIs.I think the editors for plugins, marketplace, mcps etc are really awkward to navigate in TUI (I think it is a misfit). IMO claude code should naively use a WebView to implement thse.
An example mod with richer GUI for Plugins/Marketplace editor:
<img width="1292" height="892" alt="Image" src="https://github.com/user-attachments/assets/17c3ba03-ca93-46c8-8b6a-e6cfc478db48" />