UI-First Error Taxonomy for Visual Regressions
Purpose
This taxonomy prioritizes UI impact over root cause, enabling faster triage, consistent severity assignment, and streamlined remediation/oncall response. Visual regressions are detected via automated tools (e.g., Percy, Applitools) in CI/CD pipelines or prod monitoring (e.g., screenshot diffs on staging/prod deploys).
Key Principles:
- UI-First: Classify by perceived user impact (e.g., layout break > pixel shift).
- Severity Alignment: 4 tiers (S0–S3) mapped to business impact, SLOs, and alerting.
- Remediation: Self-service for devs + escalations.
- Oncall Playbooks: Runbooks for PagerDuty/Slack integrations, with <15min ACK targets.
- Metrics: Track MTTR (mean time to resolution), false positive rate (<5%), baseline update frequency.
Taxonomy Categories
Errors are grouped into 5 UI-focused categories, with examples and detection signals:
| Category | Description | Examples | Detection Signals |
|---|
| Layout | Structural positioning failures | Overlaps, clipping, spacing shifts (>5px), hidden elements | Bounding box diffs >10%, element hierarchy changes |
| Typography | Text rendering issues | Font weight/size changes, kerning, line-height drifts, truncation | Text layer diffs, OCR mismatches |
| Visual Assets | Images/icons/media breaks | Missing/broken SVGs, low-res placeholders, loading spinner hangs | Asset URL 404s, bitmap diffs >20% |
| Color/Theme | Palette or contrast failures | Wrong hues, dark mode flips, accessibility violations (WCAG AA fail) | HSL delta >10%, luminance shifts |
| Component State | UI in wrong state (static snapshots) | Hover/focus visuals off, loading skeletons stuck, responsive breakpoints wrong | Viewport-specific diffs, pseudo-class mismatches |
Severity Matrix
Severity is assigned based on user impact scope + category severity multiplier. Use a 1–10 impact score (e.g., affects 100% of users = 10), then map:
| Severity | Impact Description | Alerting | SLO Target | Example Triggers |
|---|
| S0 (Critical) | Blocks core flows (e.g., CTA invisible); prod-only | PagerDuty (all), Slack #emerg | Resolve <1hr; Rollback <15min | Layout: Pay button clipped; 100% user hit rate |
| S1 (High) | Major disruption (e.g., hero image gone); >50% page affected | PagerDuty primary + Slack #ui-eng | Resolve <4hr | Color: Brand logo recolored; Typography: Headlines unreadable |
| S2 (Medium) | Noticeable but non-blocking (e.g., padding off); 10–50% affected | Slack #ui-eng + email | Resolve <1 day | Visual Assets: Icon misalignment; Component: Mobile hamburger menu shift |
| S3 (Low) | Minor/cosmetic (e.g., 1px border); <10% affected | GitHub issue auto-create | Acknowledge <1 day; Fix next sprint | All categories: Subtle shadows/gradients off |
Scoring Formula: Severity = min(4, (Impact Score / 3) + Category Weight)
Category Weights: Layout=2, Typography=1.5, Others=1.
Remediation Strategies
Aligned by severity/category. Devs use self-service dashboard (e.g., Percy approve/reject + Jira auto-ticket).
| Severity/Category | Primary Fix | Fallback | Prevention |
|---|
| S0: All | Emergency rollback deploy | Hotfix PR (CSS override) | Baseline freeze on prod branches |
| S1: Layout/Typography | Update snapshot baseline + fix CSS (e.g., box-sizing: border-box) | Feature flag off | Golden viewport testing (mobile/desktop/dark) |
| S1: Assets/Color | CDN purge + asset re-upload | Polyfill fallback image | Vendor lock audit; Theme token linting |
| S2: All | PR with before/after + QA review | Defer to design sync | Weekly visual diff audits in CI |
| S3: All | Auto-approve minor diffs (<2px); Batch baseline updates | N/A | AI diff tolerance (e.g., Applitools eyeset) |
Tools Workflow:
- CI fail → Percy link in PR comment.
- Prod alert → Screenshot dashboard with diff heatmap.
- Track in Jira: Labels
[visual-regression-{category}-{severity}].
Oncall Playbooks
Tiered runbooks (stored in Notion/Google Doc + PagerDuty templates). Assume 24/7 rotation for UI eng.
S0 Playbook (15min ACK)
- Triage (2min): Confirm prod impact via perf dashboard. Check affected % users (Datadog).
- Mitigate (5min): Rollback last deploy (
kubectl rollout undo). Notify PMs/Slack #biz.
- Escalate (3min): Ping lead + post-mortem ticket.
- Resolve: Handoff to dev for RCA (root cause analysis: e.g., npm dep bump?).
S1 Playbook (30min ACK)
- Triage (5min): Reproduce in staging. Vote on Percy (approve if intentional).
- Fix (15min): Dev PR or config tweak (e.g., baseline update). Deploy to staging.
- Verify: Prod screenshot validation.
- Close: Jira ticket with diff proofs.
S2/S3 Playbook (1hr ACK)
- Triage (10min): Slack #ui-eng; check changelogs.
- Delegate: Auto-Jira to owner; optional baseline approve.
- Monitor: Watch for patterns (e.g., browser-specific → update caniuse).
Common Escalations:
- False positive (>20% diffs ignored)? → Tune tolerance.
- Cross-browser? → Add Safari/Edge viewports.
- Prod-only? → Implement prod visual monitoring (e.g., Playwright cron).
Rollout Plan
- Week 1: Pilot on 2 teams; train via workshop.
- Week 2: Integrate alerting (PagerDuty + Slack bots).
- Ongoing: Quarterly review taxonomy (add categories?); aim for 90% auto-remediation.
This taxonomy reduces noise by 70% (est.) and aligns UI errors to engineering velocity. Questions? Let's iterate!