Skip to content

Host the site preview at the dashboard layout so it persists across routes#3822

Open
youknowriad wants to merge 1 commit into
trunkfrom
claude/great-merkle-d33754
Open

Host the site preview at the dashboard layout so it persists across routes#3822
youknowriad wants to merge 1 commit into
trunkfrom
claude/great-merkle-d33754

Conversation

@youknowriad

Copy link
Copy Markdown
Contributor

Related issues

How AI was used in this PR

Implemented with Claude Code in a pair session: it ported and adapted the preview-persistence architecture from #3646 onto the split-preview implementation that landed in #3817, with human review of the approach, scope trims, and manual testing of the result.

Proposed Changes

Today the site preview is owned by the session view, so any navigation — switching sessions, opening Settings — unmounts the webview and the next visit pays a full reload (white flash, lost scroll position, cold page). This PR moves preview ownership up to the dashboard layout, as in the agentic UI redesign:

  • Navigating between sessions of the same site keeps the preview exactly where it was — no reload, no flicker.
  • Navigating to routes without a preview (Settings, site settings) slides the panel closed but keeps the last previewed site's webview warm, so coming back is instant.
  • The panel's open/closed state and current path are now remembered across navigation instead of resetting per session. Closing the preview in one session keeps it closed in the next (intentional behavior change).
  • Annotations submitted from the preview are routed to whichever session is currently on screen.

The split/animation/resize mechanics from #3817 are unchanged — they moved into a reusable PreviewSplitFrame component so the layout and the session view share them.

Testing Instructions

  1. Open a session for a running local site, browse the preview to an inner page (e.g. /wp-admin/).
  2. Switch to another session of the same site → the preview must not reload and keeps the page.
  3. Switch to a session of a different local site → the panel stays open; the webview swaps to the new site.
  4. Go to Settings → the panel slides closed. Return to the session → it reopens instantly with the same page (no reload).
  5. Close the preview with the header toggle, switch sessions → it stays closed; the app-menu toggle works from any route.
  6. Annotate + Submit in session A → message lands in A. Switch to session B and submit annotations → lands in B.
  7. A live-environment session shows no preview and no toggle.
  8. Drag and keyboard-resize the panel (arrows, Home/End on the focused handle); width persists across restarts.
  9. Long Settings page still scrolls; verify both light and dark mode.

Pre-merge Checklist

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

🤖 Generated with Claude Code

…outes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 3e24200 vs trunk

app-size

Metric trunk 3e24200 Diff Change
App Size (Mac) 1354.74 MB 1354.75 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk 3e24200 Diff Change
load 1632 ms 1653 ms +21 ms ⚪ 0.0%

site-startup

Metric trunk 3e24200 Diff Change
siteCreation 8025 ms 9028 ms +1003 ms 🔴 12.5%
siteStartup 3915 ms 4432 ms +517 ms 🔴 13.2%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

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