Repository navigation
Conversation
A project or user dormouse.yml entry may declare `render: webview`: once it serves, the Tool's page shows in a pane webview at its real origin, sized by its pane like an iframe Tool. On a host without pane webviews it shows in the proxied iframe as an iframe Tool, its stored mode kept. Built-ins stay iframe, and neither the Display modal nor the Wall's swap gives a built-in, or any Tool on a host without pane webviews, the webview. WebviewPanel learns the two things a Tool needs from it: it reports ready on a page load, so a preview switch no longer waits out its fallback, and it navigates when the run announces another port or path, keyed on the announcement rather than `url`, which the view writes on every navigation. Specs: the render value and the built-in rule in dor-tool.md, a Tool as a webview entry point and the follow rule in webview-pane.md, no theme for pane webviews in theme.md. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…webview A Tool declared render: webview opens its view at the port its own run serves, which the user did not type. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Deploying mouseterm with
|
| Latest commit: |
8bc0457
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ef13fa56.mouseterm.pages.dev |
| Branch Preview URL: | https://tool-render-webview.mouseterm.pages.dev |
dormouse-bot
left a comment
There was a problem hiding this comment.
On a host without pane webviews, a render: webview Tool loses its preview-slot ghost, even though it otherwise behaves as an iframe Tool there. In lib/src/components/wall/preview-transition.ts, capturePreviewGhost keeps the framed document as a layer ghost only when resolveRenderMode(params) === 'iframe'. A webview Tool falling back in VS Code still has renderMode: 'webview' stored, so it falls through to the screencast branch. That branch finds no automation controller and returns { kind: 'image', frame: null }. Every dor open --preview retarget of such a Tool in VS Code then flashes an empty ghost instead of holding the old page, which is the hold that dor-tool.md -> "Switching the slot" requires. The PR body lists the blank ghost only as a limit of the real pane webview.
Testing rendersInIframe(params) (already in browser-surface.ts, and what BrowserPanel and retainsLivePage use) fixes the fallback and leaves standalone on the image path. That matters because a layer ghost there would mount a second WebviewPanel for the same Surface id. The line is outside this diff, so I can push it as a commit if you'd like.
On a host without pane webviews a render: webview Tool is framed, but its stored mode sent the switch down the screencast branch and its ghost was blank. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
Fixed in 8bc0457: |
|
Confirmed: the switch to rendersInIframe(params) in 8bc0457 resolves the blank fallback ghost, and standalone stays on the image path. Nothing further from my review. |
dormouse-bot
left a comment
There was a problem hiding this comment.
I'm leaving this as a comment rather than an approval because two things in the PR body still need your call, and neither is a code finding. First, a webview Tool's page loses the isolation the iframe proxy gives it today (S143 and the service-worker 403): Tools share cookies, and a service worker one Tool leaves behind can control a later Tool on the same port. Second, nothing has run yet in the one host that has pane webviews. If both are acceptable as stated, I have nothing else to raise.
|
Holding this until a Tool needs it; #1938 says why and what would restart it. The branch |
A Tool declared in a project or user
dormouse.ymlmay now setrender: webview. Its page shows in a pane webview at its real origin, with no proxy in between. This follows the save protocol (#1910, #1915, #1923), which made save and unsaved state independent of the renderer.Nothing here has been seen running in the standalone app. Only Tauri has pane webviews; see "Not verified".
Behavior
iframestays the default. The display chooser also offers a declared Tool the webview where the host has pane webviews.render: webviewTool shows in the proxied iframe with its mode kept stored, as webview browser Surfaces already do. Onedormouse.ymlworks everywhere.S304).viewport: pane-sync.Security
S158changes. It said a pane webview opens "only at a URL the user chose"; it now adds "or a Tool they launched serves on loopback". A Tool's URL comes from the port scan or OSC 367 announcement of a Tool the user launched or approved.One property to weigh: a webview Tool is a real page at
127.0.0.1:<port>in the one pane-webview profile. Cookies are shared across Tools, and a service worker one Tool leaves can control a later Tool on the same port, as in any browser. The iframe proxy prevents both today (S143, the 403 on service-worker requests). Built-ins are unaffected while they stay on the iframe. No audited rule other thanS158is edited, andscripts/outbound-lint.mjsis untouched.Limits, stated in the specs
webview-pane.md).render: webviewdiscards the session, since one unreadable pane fails the whole file.Verified
9b11a2f5d:pnpm test:checks,pnpm test:packagesandpnpm test:lib(7,486 passed, 24 skipped), run one after another, plustsc -binlib. After that commit:pnpm test:checkson theS158wording, andtsc -bplus the preview-slot suites on the ghost fix.urlinstead of the announcement.Not verified
🤖 Generated with Claude Code