Repository navigation
test(webview): use the real VS Code toolkit in Playwright visual baselines - #2163
zoomote2[bot] wants to merge 2 commits into
Conversation
The gallery vite config resolved @vscode/webview-ui-toolkit/react to the Vitest mock for every story except realToolkitImporters (only the Ollama story). The mock draws a plain input with the label after the field, so baselines showing toolkit components did not look like the extension, which renders the real custom elements with the label above the field, padding, and borders. Drop the playwright-gallery-toolkit-mock plugin so every story imports the real toolkit, and keep pre-bundling it via optimizeDeps.include so a cold Vite cache does not re-optimize and reload mid-test. The Vitest mock stays in place for unit tests.
Baselines for the nine stories that render toolkit components, captured by the pinned mcr.microsoft.com/playwright:v1.62.1-noble container via the Visual Regression workflow: auto-approve settings, Bedrock custom ARN, empty history, IO Intelligence, OpenAI-compatible Azure guidance and extra body, telemetry banner, terminal settings, and UI settings. The real toolkit draws text-field labels above their inputs and gives checkboxes, textareas, links, and buttons the extension's borders and padding, so these baselines now match what users see.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
No code issues found. The gallery vite config change is clean, and the 26 regenerated baselines are consistent with the pinned-container Reviewed 4e740da |
Review statusThis PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging. Current step: Mark the PR ready. Required CI must pass before CodeRabbit starts. Review-state labels are managed by this workflow; do not edit them manually. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #2105
Description
The Playwright Story Gallery mocked the VS Code toolkit. Visual baselines rendered the mock, not the real components. Baselines did not match the extension (labels below inputs, no padding or borders).
This PR removes the toolkit mock from the gallery. Every story that uses toolkit components now renders the real components. This extends the approach from PR #1299 (Ollama story) to all stories. It replaces the per-story allowlist, which would need about 60 entries.
Key changes:
Points for careful review:
mainand this branch produce the same 68/5 failure split on a host run. All failures are pre-existing host font-metric pixel noise. No functional failures. No net-new failures from this change.Test Procedure
mainon the host. Record the failure set (68 failed, 5 flaky, all pixel diffs from host font metrics).visual-regression.ymlworkflow. Take the container-rendered actuals as the new baselines.pnpm typecheck. Result: pass.Note: the repository forbids host-generated baselines. All committed baselines come from the pinned CI container.
Pre-Submission Checklist
*.visual.tsxbaselines inwebview-ui/.Visual Snapshots
The primary artifacts are the 26 regenerated committed baselines across 9 stories. Before/after pairs were reviewed during validation: labels move above inputs, and inputs show real toolkit borders and padding.
Videos (interaction / animation only)
Not applicable. No interaction or animation changes.
Documentation Updates
This change is test infrastructure only. It changes no user-facing functionality.
Additional Notes
Baselines were regenerated by the pinned Playwright container through the
visual-regression.ymlworkflow, per the documented fallback for environments without Docker.Get in Touch
Discord: 0x7777777_