Agentic UI: Make the agent's preview refresh drop the cache like the toolbar's does - #4625
Open
shaunandrews wants to merge 1 commit into
Open
Agentic UI: Make the agent's preview refresh drop the cache like the toolbar's does#4625shaunandrews wants to merge 1 commit into
shaunandrews wants to merge 1 commit into
Conversation
…toolbar's does Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Electron previews so agent-triggered refreshes clear cached assets while preserving navigation behavior and responsive emulation.
Changes:
- Routes same-URL agent refreshes through the cache-clearing reload path.
- Reapplies simulated viewport settings after every webview load.
- Adds Electron webview regression tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
apps/ui/src/components/site-preview/index.tsx |
Unifies refresh behavior and restores viewport emulation per load. |
apps/ui/src/components/site-preview/index.test.tsx |
Tests refresh, navigation, and responsive emulation behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Related issues
refresh_browser; this is the call not working).How AI was used in this PR
Claude Code found the cause and wrote the fix and tests. Both behavior claims verified by stashing the component change and confirming the new tests fail without it.
Proposed Changes
Reported in Agentic UI testing: agent made changes, preview didn't update. Pressing ⟳ by hand worked.
refresh_browserre-navigated with a warm cache, serving back the CSS/JS it had just edited.<webview>path had no test coverage.Second fix, same area:
Testing Instructions
Run from a normal checkout, not a worktree — worktrees lack the untracked
wp-filesruntime assets, so sites won't start.Refresh:
trunkit doesn't.Emulation:
Regressions:
Pre-merge Checklist
tscerrors in both changed files.npm run typecheckfails on AI-credits breakage (allowanceRemaining,ADD_AI_CREDITS_URL) in untouched files, anduse-app-menu-navigation.test.tsxfails to collect because@wp-playground/blueprints/blueprint-schema-validatorisn't installed in this worktree.🤖 Generated with Claude Code