Automattic / Automattic/wp-codebox

Visual compare can screenshot before local stylesheets finish loading

Offen
#2,401 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
16
Forks
4
Ø Merge
59 Min.
Gemergte PRs (30 T.)
131

Beschreibung

## Problem

`wordpress.visual-compare` can produce and classify a pixel diff while local linked stylesheets are still pending. `waitForVisualComparePaintReady()` caps its load wait and stylesheet wait at 10 seconds each, even when the command has a substantially larger wall timeout. Capture diagnostics then report pending stylesheets and low-confidence readiness, but the already-written screenshots continue into comparison as if they were conclusive.

This can create a false large layout delta when a pending stylesheet owns responsive visibility or geometry.

## Expected behavior

- Use a bounded stylesheet-readiness budget derived from the visual command timeout.
- Preserve enough wall time for settling, snapshots, screenshots, and diagnostics.
- Do not classify screenshots as conclusive visual evidence when required local stylesheets remain incomplete.
- Cover delayed local stylesheet loading with deterministic tests.

## Acceptance criteria

1. A local stylesheet that completes within the derived readiness budget is applied before capture.
2. A stylesheet that remains pending after the budget produces explicit incomplete-capture evidence rather than a misleading visual-diff classification.
3. Existing external-request isolation and overall command bounds remain intact.

## AI assistance

OpenAI GPT-5.6 Sol via OpenCode diagnosed the capture evidence, traced the owning implementation, and drafted this issue under human direction.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne bei waitForVisualComparePaintReady() und verfolge den wordpress.visual-compare-Erfassungspfad einschließlich Diagnostik, Stabilisierung, Snapshots und Screenshots. Teste das verzögerte Laden lokaler Stylesheets mit deterministischen Tests; die Arbeit ist abgeschlossen, wenn die Bereitschaft den Befehls-Timeout verwendet, ohne die Isolation externer Anfragen zu beeinträchtigen, und ausstehende Stylesheets explizite Belege für eine unvollständige Erfassung liefern statt einer eindeutigen Visual-Diff-Klassifizierung.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
testing-qa
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Aktiv
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.