Repository navigation
IDE: webviews for VS Code extensions, and the Code-XR extension running inside the IDE (#261 part 2, #262) - #295
Merged
Merged
Conversation
- window.createWebviewPanel opens an editor tab, registerWebviewViewProvider fills a contributed view of type webview (activating onView first) - Each webview is a sandboxed iframe on its own origin codexr-webview://<random id>/, served by the main process with VS Code's default styles and a bootstrap: acquireVsCodeApi (postMessage, getState, setState), --vscode-* theme variables updated live, workbench shortcuts - asWebviewUri files only from localResourceRoots (links followed); command: links only as enableCommandUris allows, checked in the main process; http(s)/mailto open outside; frame navigation off the scheme is blocked - Frames live in one layer over the workbench and keep running while their tab or view is hidden - CSP frame-src codexr-webview: only
) - The Code-XR .vsix installs from file and runs unchanged: its container and tree, Python environment, LivePanel (browser or webview panel), XR analyses, servers and examples - apps/ide/scripts/vsixE2e.mjs: Playwright installs the .vsix in the built IDE and checks activation, the tree and that no API is missing - CI job 'Code-XR extension in the IDE' runs it on the package job's .vsix - Known gaps documented in docs/ide/extensions.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Adrián · project thread
Finishes #261 (part 1 was #294) and does #262 (epic #251).
Webviews (#261)
window.createWebviewPanelopens an editor tab;registerWebviewViewProviderfills a contributed view oftype: "webview"the first time it is shown.<iframe>on its own origincodexr-webview://<32 random hex>/, served by the main process (webviewRegistry.ts+webviewServer.ts) with VS Code's default styles and a bootstrap:acquireVsCodeApi()(postMessage,getState,setState),--vscode-*theme variables andvscode-light/darkbody class updated live, workbench shortcuts forwarded.asWebviewUriserves files only fromlocalResourceRoots(links followed);command:links run only asenableCommandUrisallows (checked again in main); http(s)/mailto open outside through the usual consent.window.codexr), no popups, no top navigation, no permission; workbench CSPframe-src codexr-webview:only; the workbench's own webview frames cannot navigate off that scheme, while a frame a webview embeds itself (a local server) may.Code-XR inside the IDE (#262)
.vsixinstalls from file and runs unchanged: container and full tree, Python environment, LivePanel analyses (browser or webview panel with the local server), XR analyses, servers, examples. No missing API at start-up.apps/ide/scripts/vsixE2e.mjs(Playwright against the built IDE) + new CI job Code-XR extension in the IDE on the.vsixthe package job builds.docs/ide/extensions.md(XR scene in a webview needs the CDNs; no WebXR permission in webviews;ViewColumn.Beside).Testing
npm testinapps/ide: 856 tests, typecheck and lint clean; newtest/extensionWebviews.test.ts(protocol, event checks, resource rules incl. encoded.., links out of a root and other windows' webviews, CSP, a real host with a panel, messages, view state, a webview view).npm run ide:smokepasses.setState, an allowed and a refusedcommand:link, popup blocked, 404 outside the roots, nowindow.codexr, parent unreachable, frame kept across tab switches, live theme change, webview view in its own container. With the Code-XR.vsix: the tree, the Python env, a LivePanel in a webview panel.