# Hover Active Focus Checklist

## Objective

Require every interactive component to define all of its states before it ships.

A per-component state matrix covering rest, hover, active, focus, selected, disabled, and loading.

## 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. Enumerate the interactive components the app actually ships — buttons, links, inputs, selects, rows, cards, tabs, menu items — and give each a written matrix covering rest, hover, active, visible focus, selected, disabled, and loading. What selected and disabled mean is owned by Selection State Pattern and Disabled State Standards; this brief owns the guarantee that no component leaves a cell of the matrix empty.
2. Express each state as a change of shared tokens rather than a bespoke rule per component, so a button and a table row communicate the same state with the same values.
3. Specify what happens when states combine, because they will: focused and disabled, selected and hovered, active and loading. Choose the winner for each pair rather than letting stylesheet order decide it.
4. Hold dimensions constant across states. A border that only appears on hover, or a heavier font weight on selection, shifts the layout under the cursor — reserve the space at rest instead.
5. Do not attach meaning that exists only on hover. Touch and keyboard users never reach a hover state, so anything discoverable there must also be present on focus or permanently visible.

## 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

- Hover on a touch device is either absent or sticks after a tap, leaving a row highlighted long after the user has moved on. Treat hover as decoration, never as the only route to an action.
- Keyboard focus and selection routinely land on the same element and must stay separately identifiable — a user tabbing through a list needs to see where they are as well as what they have chosen.
- Combined states are where the matrix breaks. A disabled control that still lights up on hover, or a focused row whose outline is overwritten by the selection style, both read as defects.
- Any state that adds a border, an inset shadow, or a heavier weight has to be accounted for at rest, or the element grows and pushes its neighbours sideways.
- Focus indicators must clear both the element's own background and whatever sits next to it, including items at the edge of a scrolling container where an outline is easily clipped.
- Users who have asked for reduced motion must still get the state change; it is the transition that is dropped, not the state.
- The matrix has to cover custom controls assembled from generic containers, which is precisely where focus and disabled states are usually missing.

## 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 interactive component has a documented state matrix with no empty cells.
- [ ] States are expressed through shared tokens rather than per-component rules.
- [ ] Combined states have a defined precedence and render predictably.
- [ ] No state change alters an element's dimensions or shifts its neighbours.
- [ ] No action or information is reachable only through hover.
- [ ] Focus is visible on every focusable element and is distinguishable from selection.
- [ ] State transitions honour a reduced-motion preference without losing the state itself.
- [ ] 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.
