Skip to content

Keep the site preview webview warm with a contained surface#3851

Draft
shaunandrews wants to merge 1 commit into
agentic/window-resizing-fixesfrom
warm-preview-surface
Draft

Keep the site preview webview warm with a contained surface#3851
shaunandrews wants to merge 1 commit into
agentic/window-resizing-fixesfrom
warm-preview-surface

Conversation

@shaunandrews

@shaunandrews shaunandrews commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Related issues

  • Part of the window-resizing feature (integration branch agentic/window-resizing-fixes).

How AI was used in this PR

Built with Claude Code: hoisted the duplicated preview-surface wrapper into one place and standardized its visibility state. The diff was reviewed and typecheck confirmed.

Proposed Changes

  • Keeps the site-preview webview mounted and warm while collapsed by rendering it inside a single contained surface that toggles visibility/interactivity, instead of two separate wrappers (one inside the Electron webview path, one around the iframe fallback).
  • Collapses the surface's visibility state to a single active flag, removing the active/collapsed polarity flip between the two render paths, and switches the class composition to clsx to match the rest of apps/ui.

Testing Instructions

  1. Open the agentic UI and open a site preview (Electron webview path).
  2. Toggle the preview open/closed — the preview hides/shows and the webview keeps its state (stays warm; no reload).
  3. If testing the non-Electron iframe fallback, confirm the same hide/show behavior.
  4. Verify both light and dark schemes look correct.

Stack

Part of the window-resizing feature. Two independent PRs, both targeting agentic/window-resizing-fixes, mergeable in any order:

Review just this PR's changes: compare agentic/window-resizing-fixes...warm-preview-surface (three dots).

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant