# UX Edge-Case Checklist

## Objective

Make every UI feature state what it does when things go wrong before it counts as done.

A required list of non-happy-path behaviours — failure, empty, loading, offline, permission, mobile, and accessibility — answered per feature.

## Before You Begin

This feature is being added to an application that already exists and already
works. Do not scaffold a new project, and do not assume a blank slate.

Inspect the codebase first and establish:

- The existing application structure and where code of this kind already lives.
- The framework and version in use.
- The existing design system — colours, spacing, typography, and component conventions.
- Existing UI components you can reuse instead of writing new ones.
- The existing database structure, if this feature needs to persist anything.
- The existing authentication and authorization system, if this feature is user-scoped.
- Dependencies already installed, so you don't add a library that duplicates one.
- The existing test setup and conventions.

Only start writing code once you understand the above. If the application
already implements part of this feature, extend it rather than replacing it.

## Implementation Instructions

1. Attach the checklist to the point where work is proposed and to the point where it is reviewed, so the answers exist before the feature is built rather than being reconstructed afterwards.
2. Require a concrete answer for each category: what the empty state says and what it offers, what appears while data is loading, what the user sees when the request fails, and what a user without permission gets instead.
3. Make each answer an outcome someone else could verify. A feature that says errors are handled has not answered; one that says a failed save keeps the form open with the values intact and a retry has.
4. Insist on recovery, not just display. For every failure the checklist names, state how the user gets back to a working screen — retry, undo, a route out, or a preserved draft.
5. Do not treat the checklist as a fixed form to be filled identically each time. Cut the categories that genuinely do not apply, say why in a line, and add the ones this particular feature needs — a rigid template invites the same empty answers on every feature.

## UI and UX Requirements

Match the application's existing design system exactly. Reuse its components,
spacing, and typography. This feature should look like it was always there.

## Responsive Requirements

Works on mobile, tablet, and desktop. Touch targets are large enough to hit on a
phone, and nothing overflows horizontally at 320px.

## Accessibility Requirements

- Fully keyboard navigable.
- Correct semantic elements and ARIA roles.
- Visible focus states.
- Meets WCAG AA contrast.
- Dynamic changes are announced to screen readers.
- Respects prefers-reduced-motion.

## Edge Cases

- Categories that do not apply must be marked as not applicable with a short reason, because a blank line and a considered exemption look identical once the feature has shipped.
- Concurrency belongs on the list: two people acting on the same record, the same person acting in two tabs, and a second action fired while the first is still in flight all need stated outcomes.
- Repeated actions need their own answer — a double-clicked submit, a held-down key, a rapidly retried request — and the answer is usually that the second attempt is absorbed rather than duplicated.
- Recovery is the half most often skipped: showing an error is not handling it, and the checklist should be considered unanswered until the route back to a usable state is written down.
- Vague answers are worse than none, because they pass review and provide no bar to test against — reject anything phrased as handled gracefully or shows a friendly message.
- Offline and slow are different failures with different answers, and a feature that only considers the fully offline case will spin forever on a bad connection.
- The checklist covers the shape of a feature's behaviour; a component's own internal contract belongs to Component Acceptance Criteria, and the two should not both try to specify the same keyboard handling.

## Testing

Exercise the feature end to end in the running application. Cover every edge case
above, then run the existing test suite and confirm nothing regressed.

## Acceptance Criteria

- [ ] Every UI feature carries answers for failure, empty, loading, offline, permission, mobile, and accessibility before it is built.
- [ ] Categories marked not applicable carry a stated reason.
- [ ] Each answer describes a verifiable outcome rather than a general assurance.
- [ ] Concurrent and repeated actions have explicit stated behaviour.
- [ ] Every named failure has a written route back to a working state.
- [ ] The checklist is adapted per feature, with categories added and removed deliberately.
- [ ] Review treats an unanswered or vague category as unfinished work.
- [ ] The feature matches the existing design system.
- [ ] No existing functionality is broken.

## Adaptation Rules

- Match the existing design system. Do not introduce a new colour palette,
  spacing scale, or component library.
- Reuse existing components and utilities wherever they fit.
- Follow the naming, file layout, and code style already present.
- Do not upgrade, replace, or remove existing dependencies to make this
  feature fit. Adapt the feature to the app, not the app to the feature.
- Do not break existing functionality. If a change is genuinely required in
  existing code, make the smallest one that works and say so.
- If something in these instructions conflicts with how the application is
  built, follow the application and explain the deviation.

## Final Verification

Before you report the work as done:

1. Re-read the acceptance criteria above and check each one against what you
   actually built.
2. Run the application and exercise the feature end to end.
3. Run the existing test suite and confirm you have broken nothing.
4. Check the feature on mobile, tablet, and desktop widths.
5. Check keyboard navigation and focus handling.
6. Summarize what changed: files added, files modified, and anything you
   deliberately did differently because of how this application is built.

If any acceptance criterion is unmet, fix it before reporting completion.
