dom · Easy · accessible sorting
A results table can be sorted by score or name. Equal values currently jump between renders and the live-region summary describes the requested direction rather than the order actually applied.
Task
Return a stable ordered ID list and one concise announcement for the applied sort.
Contract
Input is {rows, sort:{field,direction}}. Rows contain id, name, score and originalIndex. Return {ids, announcement}. Invalid fields fall back to name; invalid directions fall back to asc.
Acceptance criteria
- Sort score numerically and name with localeCompare.
- Use originalIndex then id as deterministic tie breakers.
- Do not mutate rows.
- Announce the normalized field and direction with the result count.
Constraints
- Do not mutate caller-owned input.
- Keep the supplied framework adapter and public contract unchanged.
- Add candidate tests for at least one boundary not covered by the public cases.
Editable files
src/repair.js— Task-specific state or service boundarytests/candidate.test.js— Candidate-authored regression