Skip to content

W-20244028: feat(webapp): Live Preview dev server error panel and proxy API#28

Open
ankitsinghkuntal09 wants to merge 10 commits intomainfrom
u/ankitsinghkuntal09/W-20244028/preview-server-management
Open

W-20244028: feat(webapp): Live Preview dev server error panel and proxy API#28
ankitsinghkuntal09 wants to merge 10 commits intomainfrom
u/ankitsinghkuntal09/W-20244028/preview-server-management

Conversation

@ankitsinghkuntal09
Copy link
Copy Markdown
Collaborator

@ankitsinghkuntal09 ankitsinghkuntal09 commented Feb 17, 2026

W-20244028 – Manage preview server lifecycle

What

  • Dev server error panel: "No Dev Server Detected" page with Quick Actions (Retry, Start npm run dev, Restart, Force Kill, Proxy-only).
  • Proxy API: GET /_proxy/status, POST /_proxy/start-dev, POST /_proxy/set-url for Live Preview / CLI integration.
  • ErrorPageRenderer: Renders error-page template with Quick Action buttons.
  • resolveDirectDevCommand: Resolves npm run dev / yarn dev to node_modules/.bin binary (avoids workspace conflicts).
  • DevServerManager / ProxyServer: Start-dev emission, status endpoint, dev server URL handling.

Files

  • src/commands/webapp/dev.ts: connects the error page actions (Start, Restart, Force Kill) to the CLI’s DevServerManager and proxy, and cleans up orphan dev servers
  • src/proxy/ProxyServer.ts: adds the HTTP API (/_proxy/status, start-dev, restart, force-kill, set-url, retry, proxy-only) that the error page and Live Preview use, and adds proxy-only mode so the “dev server down” behavior can be turned off when the user only wants the proxy for API/auth.
  • src/server/DevServerManager.ts:adds PID file persistence so the next CLI run can kill an orphan dev server (AC2), direct binary resolution so dev server start works in monorepos, getPid() so the CLI can force-kill the process, and correct cleanup of the PID file on stop/exit so the file doesn’t get stale.
  • src/server/resolveDevCommand.ts
  • src/templates/ErrorPageRenderer.ts
  • Tests: ProxyServer.test.ts, resolveDevCommand.test.ts, ErrorPageRenderer.test.ts
  • Fixture: test/fixtures/dev-server-resolve/package.json

@W-20244028@
Screenshot 2026-02-17 at 10 09 33 AM
Screenshot 2026-02-17 at 12 15 33 PM

ankitsinghkuntal09 and others added 4 commits February 16, 2026 22:42
…243732)

- Error page with Quick Actions when dev server down
- Proxy API: /_proxy/status, set-url, retry, start-dev, restart, force-kill, proxy-only
- resolveDevCommand: npm run dev/yarn dev via node_modules/.bin
- Tests: ProxyServer, ErrorPageRenderer, resolveDevCommand, fixtures

Co-authored-by: Cursor <cursoragent@cursor.com>
…21111977)

- ErrorPageRenderer: use getErrorPageTemplate() from package; remove local file read
- Remove src/templates/error-page.html (template lives in webapps proxy package)
- README: drop copy step for error-page; document package as source
- resolveDevCommand/DevServerManager: generic monorepo comments

Co-authored-by: Cursor <cursoragent@cursor.com>
@ankitsinghkuntal09 ankitsinghkuntal09 requested a review from a team as a code owner February 17, 2026 07:32
ankitsinghkuntal09 and others added 5 commits February 17, 2026 14:02
…re-dangle, numeric-separators

Co-authored-by: Cursor <cursoragent@cursor.com>
…static methods

Co-authored-by: Cursor <cursoragent@cursor.com>
…dd Retry Detection to error page fallback

Co-authored-by: Cursor <cursoragent@cursor.com>
…e varies in CI)

Co-authored-by: Cursor <cursoragent@cursor.com>
…tions markup

Co-authored-by: Cursor <cursoragent@cursor.com>
@ankitsinghkuntal09 ankitsinghkuntal09 changed the title W-20243732: feat(webapp): Live Preview dev server error panel and proxy API W-20243732: feat(webapp) Live Preview dev server error panel and proxy API Feb 17, 2026
@ankitsinghkuntal09 ankitsinghkuntal09 changed the title W-20243732: feat(webapp) Live Preview dev server error panel and proxy API W-20244028: feat(webapp) Live Preview dev server error panel and proxy API Feb 17, 2026
@ankitsinghkuntal09 ankitsinghkuntal09 changed the title W-20244028: feat(webapp) Live Preview dev server error panel and proxy API W-20244028: feat(webapp): Live Preview dev server error panel and proxy API Feb 17, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines +325 to +326
// AC1+AC4: Listen for "restart dev server" requests from the interactive error page
this.proxyServer.on('restartDevServer', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to add these event listeners to the proxy server in the CLI. The server can be managed directly in the terminal. Programmatic controls are likely only needed in the VS Code extension and should live in the extension itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants