The user wants a "UI-first error taxonomy" specifically for "visual regressions."
This means I need to categorize visual bugs not just by code origin (like "CSS error" or "API failure"), but by how they appear and impact the user interface (UI) and user experience (UX).
I need to align three specific components for each category:
- Severity: How bad is it? (Critical, High, Medium, Low).
- Remediation: How do we fix it immediately in the UI or code?
- Oncall Playbooks: What steps does the on-call engineer follow when an alert fires?
Deconstructing "Visual Regressions":
What causes visual regressions?
- Layout shifts (CLS).
- Color/Theme inconsistencies (Dark mode issues).
- Responsiveness issues (Mobile vs. Desktop).
- Accessibility failures (Contrast, font size).
- Missing assets (broken images, icons).
- Logic errors affecting display (rendering a loading state forever, wrong data format).
- Browser compatibility (Safari vs. Chrome).
Structuring the Taxonomy:
A standard severity matrix (SEV 1 to SEV 4) is the best framework. I will map specific visual regression types to these severity levels based on user impact.
- SEV 1 (Critical): The UI is unusable, or it blocks revenue/brand reputation significantly.
- Example: Checkout button missing, entire layout broken (white screen of death but with headers), Accessibility violation (lawsuit risk).
- SEV 2 (High): Major functionality works, but key flows are confusing or look broken.
- Example: "Buy Now" button is invisible (white on white), major layout shift pushes content off-screen, product image missing.
- SEV 3 (Medium): Cosmetic issues that don't stop the user but look unprofessional.
- Example: Misaligned text, hover states broken, minor responsive glitches.
- SEV 4 (Low): Pixel perfecting, strict adherence to design system but functional.
- Example: Wrong font weight, slight padding discrepancy.
Refining the "UI-First" aspect:
Instead of just saying "CSS Error," I should describe the visual symptom.
- Symptom: "Overlay occlusion" instead of "z-index bug."
- Symptom: "Unresponsive CTA" instead of "pointer-events: none."
Drafting the Plan Sections:
- Philosophy: Define what UI-first means (User perception > Code logic).
- The Taxonomy Matrix (The Core):
- Group by Severity (SEV 1-4).
- Define the Visual Symptom.
- Define the User Impact.
- Define Remediation Strategy (Hotfix vs. Next Sprint).
- Define Oncall Playbook steps.
- Detection Strategy: How do we catch these? (Percy, Storybook, Lighthouse).
- Process/Workflow: How to triage.
Fleshing out specific examples for the Matrix:
- SEV 1: "The Blocker." User cannot complete primary action.
- Visual: Overlay covers primary button, or button renders off-screen.
- Playbook: Revert deploy immediately.
- SEV 2: "The Brand/Revenue Risk."
- Visual: Product price overlaps image, image 404s on main hero banner.
- Playbook: Toggle feature flag off.
- SEV 3: "The Ugly." Functional but messy.
- Visual: Text truncation cuts off vital info, mobile menu overlaps footer.
- Playbook: Create ticket, assign to next sprint.
- SEV 4: "The Polish."
- Visual: Wrong shade of gray, padding 2px off.
- Playbook: Backlog.
Reviewing "Oncall Playbooks":
Playbooks need to be actionable.
- Step 1: Verify (Check production vs. staging).
- Step 2: Mitigate (Feature flag, Revert).
- Step 3: Communicate.
- Step 4: Fix.
Formatting:
Use a structured table or clear list format. Bold key terms. Use specific UI terminology (DOM, Viewport, CLS, Z-index).
Let's refine the "Remediation" part. It shouldn't just be "fix code." It should imply urgency and method.
- SEV 1: Hotfix / Rollback.
- SEV 2: Patch / Feature Flag disable.
- SEV 3: Scheduled Deploy.
- SEV 4: Trickle down.
Let's ensure I address "Accessibility" explicitly, as visual regressions often cause a11y issues (contrast, focus states). This is usually high severity due to compliance.
Self-Correction during drafting:
Initially, I might group by component (e.g., "Button errors"). But the prompt asks for a taxonomy aligned with severity. Grouping by Severity is more useful for an Oncall engineer. The taxonomy describes what visual failure fits which severity.
Key Taxonomy Categories:
- Interaction Blockers (Clickable areas broken).
- Layout Destruction (Layout shifts, overflow).
- Content Occlusion (Overlays, z-index).
- Asset/Brand Violation (Images, Fonts).
- Accessibility/Compliance (Contrast, scaling).
I will structure the response by first establishing the framework, then the detailed taxonomy table, and finally the operational workflow.
Final Polish of the Plan:
- Introduction: Why UI-first matters (User sees UI, not code).
- The Taxonomy: The core table.
- The Playbook: Step-by-step runbooks.
- Tooling: Mentioning visual regression tools (Percy, Applitools) briefly to show context awareness.
Let's write it out.
Planning a UI-first error taxonomy requires shifting focus from server status codes (500, 404) to user impact and visual state. When a visual regression occurs, the API might be healthy, but the interface is broken.
Below is a comprehensive taxonomy aligning Visual Severity, Remediation Tactics, and Oncall Playbooks.
1. The Framework: UI-First Severity Levels
We classify visual regressions not by the CSS property that failed, but by the User’s ability to complete their intent.
| Severity Level | Classification | User Impact (The "Eyes" Test) | Examples |
|---|
| SEV-1 | The Blocker | Interaction Impossible. The user cannot complete a critical flow (Checkout, Login, Save). The UI is physically broken or invisible. | • "Place Order" button not rendering.• Modal overlay has no close button.• Entire viewport is white (WSOD).• Input fields non-interactive. |
| SEV-2 | The Disruptor | Interaction Impaired. The flow works but is confusing, misleading, or extremely difficult to use. High cognitive load or frustration. | • Text overlaps images (unreadable).• Critical error messages display above the fold.• Mobile navigation menu expands off-screen.• Dark mode renders text black-on-black. |
| SEV-3 | The Eyesore | Aesthetic Degradation. The flow works perfectly, but the brand looks unprofessional or "broken." | • Logo stretched/pixelated.• Misaligned padding/margins.• Wrong font family falling back to system default.• Hover states flickering. |
| SEV-4 | The Nitpick | Pixel Imperfect. Only visible in strict design review or specific browser versions. Negligible user impact. | • 1px misalignment in a specific icon.• Minor color shade difference (#FFF vs #F5F5F5).• Scrollbar appearance on non-overflowing content. |
2. Taxonomy of Visual Regressions (The "What")
This taxonomy categorizes the type of visual failure to speed up diagnosis.
A. Layout & Geometry
- The Exploder: Flexbox/Grid breaks, causing elements to overlap or shoot off-screen.
- The Truncator: Text strings are cut off (ellipses ...) where they shouldn't be (e.g., prices showing
$10...).
- The Shifter (CLS): Content jumps during load, causing users to click the wrong element.
B. Interaction & State
- The Ghost: Interactive elements exist in the DOM but are invisible (Opacity: 0 or Display: None).
- The Zombie: Elements appear active but do not fire events (Pointer-events: None).
- The Confused State: Toggle buttons show "On" visually but logic says "Off" (or vice versa).
C. Asset & Rendering
- The Broken Image:
alt text displayed, or generic broken image icon.
- The FOUC (Flash of Unstyled Content): Page renders as raw HTML briefly before CSS loads.
- The Contrast Killer: Text becomes unreadable against the background (Accessibility violation).
3. Remediation Matrix (The "How")
This maps the Regressions to the Engineering response.
| Severity | Deployment Action | Communication | Follow-up |
|---|
| SEV-1 | Hotfix / Rollback: Immediate revert of the offending commit or feature flag disable. Do not wait for a fix. | Public: Status page update. Internal: Page the On-Call Lead. | Post-mortem required within 24h. |
| SEV-2 | Emergency Patch: If a rollback is risky, apply a CSS hotfix. If not, patch within 4 hours. | Public: Support banner ("We are aware of display issues"). Internal: Slack alert in #dev-urgent. | Ticket created for root cause analysis. |
| SEV-3 | Scheduled Fix: Add to the current or next sprint bucket. Fix within 24-48 hours. | Internal: Slack message in #design-system. | Update Visual Regression Testing (VRT) snapshots. |
| SEV-4 | Backlog: Add to the backlog as a "Polish" task. | None. | Address during regular maintenance cycles. |
4. Oncall Playbooks (The "Who & When")
Here are the specific runbooks for the On-Call Engineer responding to visual alerts.
Playbook A: The "Visual Diff Alert" (Automated)
Trigger: CI/CD pipeline detects >5% pixel difference in snapshot tests.
- Verify: Open the generated diff report (e.g., from Percy, Chromatic, or Playwright).
- Assess:
- Is it an intentional design update? -> Approve Snapshots.
- Is it a regression? -> Assess Severity using Taxonomy above.
- Act:
- If SEV 1/2: Halt the deployment. Do not merge the PR.
- If SEV 3/4: Merge, but create a "Fix" ticket immediately.
Playbook B: The "Layout Break" (User Reported)
Trigger: Customer Support tickets "I can't click the button."
- Reproduce:
- Request Browser/OS/Device info.
- Check specific viewport widths (usually mobile or tablet).
- Inspect:
- Use DevTools to check for CSS override conflicts or
z-index wars.
- Check for
overflow: hidden on containers.
- Mitigate:
- Can you fix it with CSS only? -> Push a CSS-only hotfix (fastest).
- Is it a JS logic error? -> Rollback the specific micro-frontend or component version.
Playbook C: The "Accessibility/Contrast Failure"
Trigger: Lighthouse CI or Accessibility Scanner fails.
- Diagnose: Is it a change in background color or text color?
- Context: Did a dark mode variable fail to update?
- Remediation:
- Do not deploy to Production if it violates WCAG AA standards (Legal risk).
- Hardcode a temporary fix if the design system tokens are broken.
5. Implementation Strategy: Shift Left
To make this taxonomy effective, it must be integrated into the development lifecycle:
- Unit/Integration Tests: Assert on computed styles (e.g.,
expect(button).toHaveStyle('visibility: visible')).
- Visual Regression Tests: Run snapshot diffs on every Pull Request.
- E2E Monitoring: Use synthetics to check that critical DOM elements are visible and clickable in production every 5 minutes.
Summary of Signals
- SEV-1: User halted.
- SEV-2: User confused.
- SEV-3: User disgusted.
- SEV-4: User unaware.