You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a Playwright component-test visual regression layer to webview-ui/ for components where layout, VS Code theme variables, or web-component rendering are the behavior under test — things Vitest/jsdom cannot verify.
What was added:
playwright-ct.config.ts — component test config with path aliases mirroring vite.config.ts, vscode mock alias, and absolute CI output paths
playwright/ — test harness: index.html applies the vscode-dark body class; index.tsx loads VS Code CSS variables, codicons, and the app stylesheet; vscode-theme-dark.css provides a complete set of --vscode-* tokens for the Default Dark Modern theme
playwright/run-docker.mjs — Docker runner that detects Compose v2 (docker compose) and falls back to v1 (docker-compose)
docker-compose.visual.yml — reproducible baseline environment using the pinned Playwright Noble image
.github/workflows/visual-regression.yml — CI job triggered on webview-ui/** and src/shared/** changes, runs inside the same pinned Playwright container, uploads HTML report and test results on failure
src/components/chat/__tests__/ProgressIndicator.visual.tsx — first visual test; waits for customElements.whenDefined and a requestAnimationFrame flush before screenshotting, so the snapshot captures the fully-upgraded shadow DOM
Key design decisions:
Docker is the source of truth for baselines; host-rendered screenshots are not committed
snapshotPathTemplate intentionally omits {projectName} for the single-browser setup; AGENTS.md documents that adding a second browser project requires updating the template
outputDir and HTML reporter outputFolder are resolved to absolute paths via path.resolve(dirname, ...) so artifacts land predictably in webview-ui/ regardless of where pnpm --filter is invoked from
Test Procedure
Run the visual tests locally (requires Docker):
cd webview-ui
pnpm test:visual:docker
Regenerate baselines after an intentional UI change:
pnpm test:visual:docker:update
# commit the updated __screenshots__ files alongside the component change
CI: the Webview Visual Regression workflow runs automatically on PRs that touch webview-ui/** or src/shared/**.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 19911589-018a-4eed-b509-b10bd924055e
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
🔍 Trigger review
✨ Finishing Touches🧪 Generate unit tests (beta)
Create PR with unit tests
Commit unit tests in branch issue/515
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
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
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 GitHub Issue
Closes: #515
Description
Adds a Playwright component-test visual regression layer to
webview-ui/for components where layout, VS Code theme variables, or web-component rendering are the behavior under test — things Vitest/jsdom cannot verify.What was added:
playwright-ct.config.ts— component test config with path aliases mirroringvite.config.ts,vscodemock alias, and absolute CI output pathsplaywright/— test harness:index.htmlapplies thevscode-darkbody class;index.tsxloads VS Code CSS variables, codicons, and the app stylesheet;vscode-theme-dark.cssprovides a complete set of--vscode-*tokens for the Default Dark Modern themeplaywright/run-docker.mjs— Docker runner that detects Compose v2 (docker compose) and falls back to v1 (docker-compose)docker-compose.visual.yml— reproducible baseline environment using the pinned Playwright Noble image.github/workflows/visual-regression.yml— CI job triggered onwebview-ui/**andsrc/shared/**changes, runs inside the same pinned Playwright container, uploads HTML report and test results on failuresrc/components/chat/__tests__/ProgressIndicator.visual.tsx— first visual test; waits forcustomElements.whenDefinedand arequestAnimationFrameflush before screenshotting, so the snapshot captures the fully-upgraded shadow DOMKey design decisions:
snapshotPathTemplateintentionally omits{projectName}for the single-browser setup; AGENTS.md documents that adding a second browser project requires updating the templateoutputDirand HTML reporteroutputFolderare resolved to absolute paths viapath.resolve(dirname, ...)so artifacts land predictably inwebview-ui/regardless of wherepnpm --filteris invoked fromTest Procedure
Run the visual tests locally (requires Docker):
cd webview-ui pnpm test:visual:dockerRegenerate baselines after an intentional UI change:
pnpm test:visual:docker:update # commit the updated __screenshots__ files alongside the component changeCI: the
Webview Visual Regressionworkflow runs automatically on PRs that touchwebview-ui/**orsrc/shared/**.Pre-Submission Checklist
pnpm check-types,pnpm lint, and 1,342 Vitest tests all passwebview-ui/AGENTS.mdupdated with authoring guidance, Docker requirements, and multi-browser constraints