Skip to content

[Fix] Five webview visual tests fail on every pull request - #2209

Merged
edelauna merged 2 commits into
mainfrom
issue/2206-stale-visual-baselines
Oct 27, 2026
Merged

edelauna merged 2 commits into
mainfrom
issue/2206-stale-visual-baselines

Conversation

@zoomote

@zoomote zoomote Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

​Created by Roomote. Follow up by mentioning @roomote, in the web UI, or in Discord.

Related GitHub Issue

Closes: #2206

Description

#2163 switched the Playwright gallery from mocked toolkit controls to the real VS Code toolkit. It refreshed nine baselines but missed five. Unrelated pull requests and merge-queue runs then failed the same five visual tests.

This PR repairs the baselines once on main:

  • Regenerated history-rename-editor-{dark,light,high-contrast,high-contrast-light}.png and opencode-go-temperature.png inside the pinned Playwright container (mcr.microsoft.com/playwright:v1.62.1-noble at the digest pinned in visual-regression.yml). A local Docker daemon cannot run in this sandbox, so the baselines came from the documented fallback in webview-ui/AGENTS.md: dispatch visual-regression.yml on this branch, download the webview-visual-regression artifact, and copy the container-rendered -actual.png files into __screenshots__.
  • Reviewed each expected/actual/diff triplet before committing. The four history baselines show the intended change: the real toolkit places the search icon inline inside the field, so the content below shifts up. The settings baseline shows the real checkbox inline with its label, and the image height changes from 480x359 to 480x340. No text, control, or theme content changed. The light-theme input background matches the history-empty-light.png baseline that test(webview): use the real VS Code toolkit in Playwright visual baselines #2163 committed and that passes today.
  • No tolerance changes and no test suppressions. The suite config is untouched.

Merge gate changes:

  • Removed the pull_request paths filter from .github/workflows/visual-regression.yml. GitHub keeps a path-filtered workflow pending on pull requests that do not match the filter, and a required check in that state blocks merging. The workflow now reports webview-visual on every pull request, the same way code-qa and e2e already do. The merge_group event ignores path filters, so merge-queue runs do not change.
  • Recommended ruleset change (needs admin access, which this author does not have): Settings → Rules → Rulesets → "Protect Main" (id 15494382) → Require status checks to pass → add webview-visual. With the paths filter removed, the check is emitted for both pull_request and merge_group events. This check would have blocked test(webview): use the real VS Code toolkit in Playwright visual baselines #2163 from merging with its final red visual run.

Test Procedure

  1. Dispatch Visual Regression on this branch, before the fix. Result: webview-visual failed the five tests (5 failed, 73 passed) and uploaded expected, actual, and diff images.
  2. Copy the five container-rendered actuals to the baseline paths and commit.
  3. Dispatch Visual Regression on the baselines commit. Result: 78 passed, 0 failed.
  4. Commit the workflow change. Dispatch Visual Regression on the final head. Result: 78 passed, 0 failed. theme-fixtures and extension-host-visual also passed.
  5. Run pnpm test from the repo root. Result: 14 of 14 turbo tasks passed. One first-run test timed out in src/__tests__/extension.spec.ts under parallel load. It passes in isolation and on the full-suite rerun. It is not linked to this change, which touches five PNG files and one workflow trigger.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable). The updated __screenshots__ baselines are the coverage for this change.
  • Visual Snapshot (UI changes only): The committed baselines are the snapshot for this change.
  • Documentation Impact: I checked if my changes need documentation updates.
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

Visual Snapshots

The five committed __screenshots__ baselines are the durable artifact. Reviewers can compare old and new images in the artifacts of the first run. Each failing test uploaded its expected, actual, and diff image.

Videos (interaction / animation only)

None. The change has no motion or interaction.

Documentation Updates

  • No documentation updates are required.
  • Yes, documentation updates are required.

This PR changes test and CI files only. No product behavior changed.

Additional Notes

  • CI evidence that needs main: after merge, rerun the visual job on an affected PR (for example [Fix] Completed task fails to resume after restart when a message write is interrupted #2136) or push any new commit to it. Also confirm the next merge-queue entry passes. These runs pick up the new baselines only after the fix lands on main.
  • After an admin adds the required check, verify with a PR that does not touch webview-ui/**. The checks view must show webview-visual as reported, not a pending "Waiting for status" entry.

Get in Touch

Discord username: 0x7777777_

Regenerate the five baselines that #2163 left on the mocked toolkit
rendering: history-rename-editor in all four themes and
opencode-go-temperature. Captured by the pinned
mcr.microsoft.com/playwright:v1.62.1-noble container via the Visual
Regression workflow on this branch.

The real toolkit places the search field's icon inline inside the field
and renders the custom-temperature checkbox inline with its label
(480x359 -> 480x340), matching the intended appearance from #2163.

Fixes #2206
The Protect Main ruleset should require the webview-visual check. GitHub
keeps path-filtered workflows in a pending state on pull requests that
do not match the filter, so a required check would block those PRs from
merging. Remove the pull_request paths filter so webview-visual,
theme-fixtures, and extension-host-visual report on every pull request,
like code-qa and e2e already do. The merge_group event ignores path
filters, so merge-queue runs are unchanged.
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one): 1
  • coderabbit-review-active

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

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zoomote

zoomote Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

No code issues found. See session

Reviewed the five refreshed baselines against the pre-change versions and the passing history-empty-* references: only the intended real-toolkit rendering changes (inline search icon, inline checkbox, 480x340 height) are present. The workflow change matches how e2e and code-qa already report on every pull request, and the dispatched webview-visual run passed on this exact head (78/0).

Note: the failing e2e-mock check is a GitHub Actions runner timeout (hashFiles(...) couldn't finish within 120 seconds, e2e.yml line 28), not caused by this diff — rerun it.

Reviewed 82c6fd2

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review status

This PR was opened by an automated account. A human maintainer must verify the change intent, provenance, and validation before merging.

Current step: The required review sequence passed. Remaining merge requirements apply.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@edelauna
edelauna marked this pull request as ready for review October 27, 2026 21:00
@edelauna
edelauna enabled auto-merge October 27, 2026 21:00
@edelauna
edelauna added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 3b825bf Oct 27, 2026
39 of 40 checks passed
@edelauna
edelauna deleted the issue/2206-stale-visual-baselines branch October 27, 2026 21:22
easonLiangWorldedtech added a commit to easonLiangWorldedtech/Zoo-Code that referenced this pull request Nov 29, 2026
…iff default

Required check webview-visual is red on this branch, and the last push did
cause it. Job 141454402633 on head f4e769d
completed with failure, and job 141112808655 on the previous head
8365bf8 had already completed with failure.
Both failing heads carry the same experiment default change. The CI run
summary is 4 failed and 110 passed, with all four failures inside the
experimental settings theme matrix and nothing else failing.

First failure verbatim. The locator line is paraphrased, because in the CI
annotation it carries apostrophes that a quote free message cannot hold:
4) [chromium] ExperimentalSettings.visual.tsx:6:2 renders the experimental
   settings section in the VS Code high-contrast-light theme
Error: expect(locator).toHaveScreenshot(expected) failed
   Locator: root element scoped to the direct playwright mounted child, then
   filtered by test id experimental-settings-story
4 pixels (ratio 0.01 of all image pixels) are different.
Snapshot: experimental-settings-high-contrast-light.png

Cause, category ii, this pull request changed what the story renders.
Commit da7fc3a flips PREVENT_FOCUS_DISRUPTION in src/shared/experiments.ts
from enabled false to enabled true. The story fixture spreads experimentDefault
from that same module through the @roo alias, and ExperimentalFeature renders a
VSCodeCheckbox whose checked state is that value, so the Background editing row
now renders checked. The unit test this branch adds pins exactly that default:
src/shared/__tests__/experiments-preventFocusDisruption.spec.ts line 14 asserts
experimentDefault.preventFocusDisruption is true. The four baselines were last
written by 332d30f and nothing touched them after that, so they still draw
the old default. No upstream drift is involved: main added no commit under
webview-ui/src/components/settings, the experiment sources or the theme sources
after the merge base, and this pull request touches no webview rendering code
that this story mounts, because SettingsView is not on the path of the
experimental settings story.

Pixel forensics, checked image by image. In all four CI captures the difference
against the committed baseline is 40 device pixels confined to the box x 39 to
52 and y 100 to 111, which is the checkbox glyph of the Background editing row.
The count and the bounding box are identical for dark, light, high-contrast and
high-contrast-light, and every other pixel of the 488 by 589 image is identical.
Zoomed crops of the CI capture and of the baseline show the same control, empty
in the baseline and ticked in the capture. No control disappears, nothing is
added, no label or description text changes, and the Dynamic thinking effort
row stays ticked as the fixture intends. CI reports this as 4 pixels after its
own antialiasing tolerance.

Why these bytes are the container bytes rather than host bytes. The four new
files are byte identical to the actual captures uploaded by job 141454402633.
Those captures are byte identical across all three attempts of that job, and
they are byte identical to the captures uploaded by job 141112808655 on the
older head, so the pinned mcr.microsoft.com/playwright v1.64.1 image renders
these four stories the same way on every run. A calibration run with the update
flag confirmed that Playwright writes the captured png verbatim into the
snapshot path, so taking the captured bytes equals the sanctioned flow, pnpm
--dir webview-ui run test:visual:docker:update, executed inside that image.
Host rendered bytes would bury a real regression instead: on this Windows
machine the same story differs from the container capture by about 33700
pixels, the four themes differ by 33639, 33758, 33753 and 33750 pixels before
this change and by exactly 40 fewer after it, and 107 of the 114 visual tests
fail locally for that rendering reason alone. No baseline here was written by
a host run.

Counts. Targeted rerun before the change, 4 failed and 0 passed, at 13590,
12501, 16346 and 10873 differing host pixels. Full local suite before the
change, 107 failed and 7 passed. Targeted rerun after the change, 4 failed and
0 passed on this host, holding the same rendering floor, while the container
comparison for these four stories now has 0 differing pixels because the
baselines are the container capture itself. Expected CI result 0 failed and
114 passed.

Precedent for refreshing these baselines in place: 332d30f feat(settings):
dynamic thinking effort experimental toggle (DTE-1) (Zoo-Code-Org#1521) wrote these four
files, and 8254e11 fix(settings): pin Zoo Gateway provider first (Zoo-Code-Org#2419),
d76dffa feat(task-title): auto-generate task titles for new root tasks
(Zoo-Code-Org#2398), 5cc5a37 test(webview): use the real VS Code toolkit in Playwright
visual baselines (Zoo-Code-Org#2163) and 3b825bf [Fix] Five webview visual tests fail on
every pull request (Zoo-Code-Org#2209) refreshed baselines the same way.

Gates on these bytes. format check 0, lint with turbo forced 0, check types
with turbo forced 0, webview build 0. The first format pass returned 1 only
because a local visual run had written webview-ui/test-results, a directory
git ignores but prettier does not; with that generated directory removed the
check returns 0. The visual rerun exits 1 on this host for the font rendering
reason above, not for content, and it is the pinned image that decides the
gate. Only the four png files changed. No source file, no story and no
production file was touched, so the src eslint suppression counts and the
prune report stay unchanged.
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.

[BUG] Restore visual CI after #2163: five stale toolkit baselines and missing merge gate

2 participants