Semantic visual diff (element-resolved regression)
visual_diff_regionsDiff a page against a saved baseline, cluster changed pixels into regions, and identify the exact DOM element responsible—turning vague pixel percentages into actionable element-level change reports.
Instructions
Visual regression that points at code, not pixels: diffs the current render against a saved baseline, clusters the changed pixels into regions, and hit-tests each against the live DOM — so you get "button.cta-primary — 1,240 changed px" instead of "3.2% of pixels changed". A delta overlay is saved to disk. Requires a baseline from compare_to_baseline with matching fullPage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | Yes | Baseline to diff against — the name used with set_baseline. | |
| url | Yes | Absolute URL to open, e.g. http://localhost:5173. | |
| reload | No | Reload even if the URL is already open (default reuses it, so it can be stale after an edit). | |
| fullPage | No | Capture the whole scrollable page instead of the visible fold. Clipped at 7900px, and the truncation is reported. | |
| viewport | No | Switch to this breakpoint first. Default: keep the current one. | |
| maxVariancePct | No | CI gate for diff_against_baseline: FAIL when variance exceeds this percentage (0.5 = 0.5% pixel drift). Omit to report without a verdict. |