Visual Regression deterministically red after ca43e69f70: electron-chat-dark-sidebar baseline no longer matches the sidebar

Ouverte
#2,702 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 3 jours

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
Une demi-journée
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
Active
Stack technique
github-actions, typescript
Domaine
testing

Piste de recherche

Start with the Visual Regression workflow and the sidebar assertion in apps/vscode-e2e/src/visual/electron.visual.ts, then check the provider/model scenario set in sceneController.ts (lines 105-109). Confirm the mismatch against the electron-chat-dark-sidebar.png baseline, then regenerate the VS Code visual baselines with the pinned VS Code version. Done when the Visual Regression workflow passes on main with the regenerated images. The request to require baseline updates for sidebar-visible model/provider changes is a policy question for maintainers, not part of this fix.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

What happens

The Visual Regression workflow now fails on every branch, including branches that touch no UI code. The failing assertion is the sidebar screenshot in apps/vscode-e2e/src/visual/electron.visual.ts (electron-chat-dark-sidebar.png; the masks cover only the token-count and message-time regions). The Playwright annotation reports 397 pixels (ratio 0.01 of all), and the highlighted region sits directly under the task title (bounding box x 17..125, y 85..141 in the crop).

Deterministic, not flaky

  • Across three separate runs the produced actual.png is byte-identical and the produced diff.png is byte-identical, and the expected.png inside the artifact is byte-identical to the committed baseline. The mismatch is stable; the committed baseline is what no longer fits.
  • Decoding the diff image ourselves yields exactly the 397 highlighted pixels the annotation reports.
  • Newest 30 runs of the workflow: 27 completed, 27 failed (100%), across 16 different branches, none of which edit apps/vscode-e2e.

Where it starts

  • Last green: run 45545919003, completed 2026-11-25T04:31:57Z. First red: run 45548006445, created 2026-11-25T04:37:04Z. The only main commit inside that bracket is ca43e69f700173e7a238f4c19d21f18d485d0006 ("Retire Gemini CLI, correct OpenRouter costs, and verify provider usage", #2673, committed 04:20:55Z).
  • That commit touches no file under apps/vscode-e2e, no .png, and not the pinned VS Code version the workflow installs. It does change provider/model selection surfaces (src/api/providers/openrouter.ts, webview-ui/src/components/settings/utils/useSelectedModel.ts) and removes packages/types/src/providers/gemini-cli.ts.
  • The scenario pins provider openrouter with model openai/gpt-4.1 against the aimock base URL (sceneController.ts 105-109), so the changed row is model/provider metadata in the sidebar.
  • The baselines were last regenerated in e943530c84 (#2223, 2026-11-05); earlier changes that altered visible UI shipped with regenerated baselines.

What we ask

  1. Regenerate the VS Code visual baselines against the current sidebar, or otherwise re-anchor them, so the suite stops reporting a stable mismatch as a regression.
  2. Consider requiring regenerated baselines whenever a change alters sidebar-visible model/provider metadata. Today the visual red is uniform across all PRs, so a real UI regression cannot be told apart from the standing mismatch.

We are not proposing to change the test, the locators or the masks: the assertion is doing its job, and the artifact shows a stable produced image. Two unrelated lanes hit the same red, which is how we saw that it is shared rather than local.

baseline at upstream/main  electron-chat-dark-sidebar.png  28,998 B  sha256-16 47ad509b278ab68f
expected.png (artifact)                       28,998 B  sha256-16 47ad509b278ab68f  (identical)
actual.png (3 runs identical)                133,131 B  sha256-16 abe77509286af481
diff.png   (3 runs identical)                 37,347 B  sha256-16 bb5dc9432ac755aa
artifact 15035141973 zip                  18,227,047 B  sha256-16 498d2d0335ae28d5
onset bracket: only main commit ca43e69f70 (PR #2673; 35 files, 1130+/167-, zero apps/vscode-e2e files, zero .png)
workflow id 290993158; newest 30 runs: 27 completed / 27 failed; 16 branches

A second, disjoint mismatch on the same screenshot

The 397-pixel measurement above describes rows 85..142 of the 300x743 capture - directly under the task title, which matches the recorded bounding box. A second, disjoint mismatch was measured on two heads of our chain at rows 237..309: there the check reports 5061 pixels (ratio 0.03 of all image pixels) are different, and a per-pixel ARGB scan of the uploaded artifact places every differing pixel inside that one band (2,308 / 6,229 / 3,768 / 1,600 when bucketed by 25 rows). That band is the task-completion actions row - the "See New Changes" and "Restore Changes" buttons plus the mask block directly beneath it.

Measurement rules, written out so the numbers are not mixed: Playwright reports 397 and 5,061 under its own antialiasing threshold; a strict per-pixel ARGB inequality scan of the same two pairs yields 734 and 13,905. The two row ranges are disjoint, and both runs carry the same stored expectation - expected.png, 28,998 B, sha256-16 47ad509b278ab68f, byte-identical to the committed file in this repository - so one baseline is currently failing in two independent places.

Provenance of the lower band: job 139687440589 (2026-11-26) and job 133379248501 (2026-11-16). Across those two runs, ten days and four main commits apart, the artifacts' actual.png (32,757 B, sha256-16 b8b22a6a12682140), diff.png (26,863 B, 953f705b200bd60e) and expected.png are byte-identical, and their error-context.md files report the same 5,061 line. The strings for those buttons exist only in webview-ui/src/i18n/locales/en/chat.json, and git log -S"See New Changes" over the base tip and over the tested head returns the same four commits; the one that introduced them is 0084cc8991 (2026-06-25, "Add completion change actions", PR 633). PR numbers here carry no leading hash on purpose, so this edit creates no new cross-references; the SHAs are the citations.

Recorded as an open question rather than answered: in the run described in the first section, rows 237..309 do not differ at all - only rows 85..142 do. The size and location of the mismatch depend on which head is under test; its existence does not. What makes each band drift is a separate question from why nothing reports either of them.

The onset bracket covers one band, not the whole problem

The bracket in "Where it starts" (last green run 45545919003, completed 2026-11-25T04:31:57Z; first red run 45548006445, created 2026-11-25T04:37:04Z; only main commit in between: ca43e69f700173e7a238f4c19d21f18d485d0006) brackets the newest runs of this workflow, and it lines up with the rows 85..142 mismatch. It does not cover the second band: on our branch the same assertion, the same snapshot and the same locator were already failing with the 5,061-pixel band on 2026-11-16 (job 133379248501, run 43890267172), nine days before ca43e69f70. The bracket is therefore the onset of one band, not of the sidebar-baseline problem.

Why nothing on main reports either band

.github/workflows/visual-regression.yml is triggered by workflow_dispatch and pull_request only - there is no push trigger - and the file records that there is deliberately no paths filter, because the workflow backs the required webview-visual check. So extension-host-visual never runs against main: a baseline can drift against main's own UI code, nothing on main reports it, and every later pull request that comes near that UI inherits a red check it did not cause and has to spend a round explaining it. The job pins its environment - Playwright container pinned by image digest (playwright:v1.64.1-noble@sha256:47b510dd…), VS Code version taken from @types/vscode and cached under that version key, LANG/LC_ALL/TZ fixed, CSS animations disabled during capture, fonts awaited - which is consistent with the byte-identical renders across ten days: the render is stable, the stored expectation is what disagrees with the code.

One addition to "What we ask": run this job against main, on push or on a schedule, so drift is detected where it happens instead of being paid for by unrelated pull requests. Items 1 and 2 above already cover regeneration; without a main run, regeneration has no signal telling it when it is needed.

Langage dominant
TypeScript
Étoiles
2k
Forks
301
Merge moyen
3 j 14 h
PR mergées (30 j)
103

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de Zoo-Code-Org/Zoo-Code

Toutes les issues de Zoo-Code-Org/Zoo-Code

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.