Interactive UI Linker opens your running web app inside VS Code, lets you click UI elements, and produces structured context that you can insert into prompts or editor files while iterating with an agent.
- Opens a live web app preview in a VS Code webview panel.
- Injects a picker script into the page through a local proxy endpoint.
- Lets you click elements and captures:
- CSS selector
- XPath
- tag name
- text snippet
- key attributes (id, class, role, data-testid, etc.)
- bounds (x, y, width, height)
- Opens an inline comment box next to the selected element.
- Sends the request to Copilot when you press
Enterin that inline box. - Copies selection context as JSON or as a prompt-ready block.
- Inserts the latest selection block directly into the active editor.
Interactive UI Linker: Open Picker PanelInteractive UI Linker: Insert Latest Selection into EditorInteractive UI Linker: Copy Latest Selection as JSONInteractive UI Linker: Copy Latest Selection Prompt
-
Install dependencies.
npm install
-
Compile extension.
npm run compile
-
Open this folder in VS Code.
-
Press
F5to launch an Extension Development Host. -
Run the command Interactive UI Linker: Open Picker Panel.
-
Enter your app URL (for example
http://localhost:3000) and click Load URL. -
Click any UI element.
-
In the inline box that appears next to it, write your request and press
Enterto send to Copilot. -
Optionally use Copy Prompt or Insert for manual workflows.
interactiveUiLinker.defaultUrl: default URL used when opening the panel.
- Extension host (
src/extension.ts):- registers commands
- manages latest selection state
- hosts local HTTP proxy (
/preview?target=...) - injects picker script into HTML
- Webview UI:
- loads proxied page in an iframe
- toggles pick mode
- shows latest selection JSON
- sends MCP-style message envelopes (
intent,prompt,notify) back to the extension
- Works best with local dev servers and pages that allow iframe embedding.
- If a target page blocks iframe embedding via
X-Frame-Optionsor strict CSP, preview may fail. - The current proxy injects picker script into HTML responses from
/preview. It does not rewrite all deep navigations across full-page reloads.
- Add a navigation-aware proxy to preserve picker injection on cross-page navigation.
- Add history panel for multi-element selection batches.
- Add a command to push selected context directly into a chosen agent workflow.