feat: preview bridge — live dev server proxy with element selection#11
Draft
Blaise1030 wants to merge 18 commits into
Draft
feat: preview bridge — live dev server proxy with element selection#11Blaise1030 wants to merge 18 commits into
Blaise1030 wants to merge 18 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements buildSelector utility with TDD. Adds local vitest.config.ts with jsdom environment and installs jsdom dev dependency. Refines dynamic class regex to require at least one digit in the suffix so semantic compound names like card-header are preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add explicit guard for document.body input returning "body" - Add browser-only comment and export DYNAMIC_CLASS_RE for unit testing - Fix misleading test comment to reflect actual digit-lookahead regex - Add tests for detached bare element and document.body edge case - Add DYNAMIC_CLASS_RE describe block with direct unit tests - Extract magic number 2 into MAX_CLASSES constant - Remove unused beforeEach import from selector.test.ts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wires pill, selector, and screenshot modules into the IIFE entry point injected into proxied pages; connects to /sidecar/ws with 2s reconnect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements a reverse proxy handler that injects the sidecar client.js script into HTML responses and rewrites absolute asset paths to stay under /sidecar/proxy/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ile write Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements extractURLs (pure, tested in isolation) and createURLLinkProvider (xterm ILinkProvider) for detecting and activating localhost/127.0.0.1 URLs in terminal output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment on lines
+38
to
+43
| http.SetCookie(w, &http.Cookie{ | ||
| Name: cookieName, | ||
| Value: target, | ||
| Path: cookiePath, | ||
| SameSite: http.SameSiteStrictMode, | ||
| }) |
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.
Summary
Adds a preview bridge that connects the IDE terminal to a proxied dev-server tab, inspired by Cursor's browser panel but implemented across two browser tabs.
localhostURLs in terminal output; normal click opens the raw server, Cmd+click opens/sidecar/proxy?target=…sidecar-clientpackage — injected script (VanJS pill UI, WebSocket client, CSS selector capture, element screenshot)client.js, WebSocket hub, screenshot persistence to.workbench/files, and refresh broadcast on file writeuseSidecarWscomposable, terminal URL link provider, element-selected paste into terminalDesign spec:
docs/specs/2026-06-06-preview-bridge-design.mdTest plan
pnpm -r buildand Go tests (go test ./server-go/internal/sidecar/...)sidecar-clientbuild is wired into Go embed pipelineNotes
This PR includes only committed changes on
browser-sidecar. There are unstaged local edits (vite config, WorkspaceView, rebuiltclient.js, landing page) not included — commit separately if needed.Made with Cursor