Automattic / Automattic/wp-codebox

Visual compare can screenshot before local stylesheets finish loading

オープン
#2,401 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
17
フォーク
4
平均マージ
59分
マージ済み PR(30日)
131

説明

## 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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

waitForVisualComparePaintReady() から開始し、診断、安定化、スナップショット、スクリーンショットを含む wordpress.visual-compare のキャプチャパスを追跡します。決定論的なテストでローカル stylesheet の遅延読み込みを検証します。完了条件は、外部リクエストの分離を壊すことなく readiness がコマンドのタイムアウトを使用し、保留中の stylesheet が確定的な visual-diff 分類ではなく、不完全なキャプチャであることを明示する証拠を生成することです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
testing-qa
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。