Tags: decocms/parity
Tags
fix(visual-diff): adaptive scrollFullPage + skeleton downgrade ceilin… …g (0.10.1) (#50) Stops the visual-diff from capturing prod home pages as "header + half the page + dead skeleton space" on heavy lazy-loaded storefronts. Three fixes, two of which were bugs in v0.10.0 that needed surfacing. 1. Adaptive scrollFullPage. Old fixed-step loop with a 10s outer race bailed at ~15000px (25 ticks x 600px), leaving the bottom half of 25000-40000px e-commerce homepages unscrolled. New loop re-measures scrollHeight every tick, waits inline for in-view skeletons to clear (up to 1500ms per step), and exits once height has been stable for 3 consecutive checks. Race timeout bumped 10s -> 45s, visual-diff timeoutMs 45s -> 90s. On miess home: 15 steps, finalHeight=8862px, stable=true, pre-screenshot skeletons=0 (was 7+ before). 2. Silent ReferenceError: __name in page.evaluate. tsx/esbuild injects a __name helper to preserve .name on arrow-function declarations inside the evaluated function body. That helper does not exist in the browser context, so the function threw immediately and the catch swallowed it — looked like a legit timeout. Fix: inline the Promises directly (no const-arrow helpers inside page.evaluate), and replace the silent catch with one that logs the actual error. 3. SKELETON_DOWNGRADE_PCT_DIFF_CEILING. The skeleton-vs-loaded downgrade was force-marking everything as low whenever the LLM mentioned "skeleton" or "placeholder", masking structural failures like "prod home has only header + skeletons forever" (34%+ pctDiff). Now the downgrade only fires below 25% pctDiff — above that, the imbalance is treated as a real regression. Plus: waitForSkeletonsToResolve budget 10s -> 5s (adaptive scroll already does inter-step waits), new pre-screenshot skeletons=N diagnostic log under DEBUG_PARITY=1. Tests: 617 pass (added 2 visual-regression cases for the pctDiff guard and the structural-failure carry-through). Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
PreviousNext