Auto-install Playwright Chromium when opening the annotation browser#3841
Open
youknowriad wants to merge 2 commits into
Open
Auto-install Playwright Chromium when opening the annotation browser#3841youknowriad wants to merge 2 commits into
youknowriad wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 38c3d01 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
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
How AI was used in this PR
Claude Code investigated the
/annotatefailure, traced it to the annotation browser bypassing Studio's shared browser launcher, implemented the fix, and wrote it up. All code was reviewed by the author.Proposed Changes
When a user runs
/annotate, Studio opens a headed Playwright browser with the annotation inspector injected. If Playwright's managed Chromium was missing or had just been version-bumped (a common situation after a Playwright upgrade), this failed with a rawExecutable doesn't exist ... Please run 'npx playwright install'error, leaving the user stuck unless they manually installed the browser.Studio's screenshot and block-validation tools already handle this gracefully: they fall back across launch targets and auto-install Playwright's Chromium on demand. The annotation browser simply wasn't using that path — it launched Chromium directly.
This change routes the annotation browser through the same shared launcher, so a missing or outdated Chromium is now installed automatically (using the bundled Playwright version, avoiding any version drift) instead of surfacing a dead-end error. Users get a working annotation browser on first run without manual setup.
Testing Instructions
rm -rf ~/Library/Caches/ms-playwright(macOS).npm run cli:build./annotate(or theopen_annotation_browsertool) against a running Studio site.npx playwright installstep required.Pre-merge Checklist