# Remediation and regression

## Conservative remediation

1. Reproduce and document the user-facing barrier.
2. Identify whether the root cause is shared or local.
3. Prefer native semantics and the smallest behavioral change.
4. Preserve API contracts, analytics, localization keys, server validation, and existing keyboard behavior that is already correct.
5. Patch the shared component when consumers can be safely retested; otherwise isolate a temporary compatibility fix.
6. Add automated checks for deterministic defects and manual acceptance steps for contextual behavior.
7. Retest adjacent states and consumers.
8. Remove temporary ARIA, CSS, or JavaScript shims after all consumers migrate.

## Common patch patterns

| Problem | Preferred direction |
| --- | --- |
| Clickable `div` | Replace with `button` or `a[href]` before adding keyboard emulation |
| Missing form name | Add a visible `label` and preserve visible-label text in the accessible name |
| Focus hidden by sticky UI | Adjust scroll padding, layout, focus placement, or overlay behavior |
| Custom modal | Use native `dialog` where support and requirements fit, or implement a complete dialog pattern |
| Color-only state | Add text, icon shape, pattern, or structural cue and retain sufficient contrast |
| Inaccessible tooltip | Move essential information into persistent help; make optional tooltip hover/focus accessible |
| Drag-only ordering | Add move buttons or another non-drag method |
| Auto-advancing carousel | Pause by default or provide a clear pause control and stable focus behavior |
| Dynamic error toast | Associate field errors and provide a summary or live status appropriate to urgency |
| Icon font control | Use semantic SVG/native icon and a visible or accessible label |

## Acceptance criteria

Write criteria from the user task:

- “A keyboard user can open, operate, and close the dialog, and focus returns to the invoking button.”
- “At 400% zoom, the checkout can be completed without two-dimensional page scrolling.”
- “The screen reader announces the field label, required state, error, and correction guidance.”

Avoid acceptance criteria that only state “add `aria-label`” or “passes axe.”

## Regression strategy

Add layers appropriate to the defect:

- unit tests for state and attribute updates;
- component tests for keyboard interaction;
- DOM tests for labels, IDs, and relationships;
- browser accessibility scans;
- visual regression at zoom, themes, and forced colors;
- end-to-end keyboard tests for critical journeys;
- manual assistive-technology scripts retained with release evidence.

Do not automate fragile screen-reader speech strings unless the tooling and maintenance model are deliberate. Prefer semantic assertions and stable task outcomes.

## Design-system prevention

For shared components, document:

- semantic contract;
- keyboard model;
- focus lifecycle;
- accessible name and description inputs;
- validation and status behavior;
- responsive and zoom behavior;
- high-contrast and reduced-motion behavior;
- unsupported compositions;
- migration notes and deprecations.

## Third parties

Record ownership and remediation options for third-party widgets, payment providers, maps, CAPTCHA, chat, consent tools, and embedded documents. Possible controls include replacement, configuration, vendor escalation, contractual acceptance criteria, accessible alternative path, and monitored exception.

## Waivers

A waiver is not a pass. Require:

- finding and affected criterion;
- user impact;
- business and technical reason;
- available workaround;
- compensating control;
- owner and approver;
- expiry date;
- replacement plan;
- retest condition.
