A workout editor needs stable exercise IDs so reordering never moves a note to the wrong exercise.
Build the example
Render a fictional routine as rows keyed by exercise occurrence ID. Reorder the IDs rather than remapping values by index. Offer keyboard-accessible move controls in addition to drag gestures, and announce the new position. Store a bounded history for undo so the last reorder can be reversed.
Write a tiny fixture with three entries and attach a note only to the middle one. Move that exercise to the top, edit it and undo the reorder. Decide whether undo restores just order or both order and edits, then make the interface match that promise. Check that focus follows the moved row.
Watch the failure boundary
Use immutable reorder operations and persist the final order as an explicit list of IDs. A request containing an unknown or duplicate ID should fail validation. If different devices edit the same plan, compare versions so the interface can explain a conflict instead of silently restoring a stale order.
Verify the behavior
Move the second item while the first is being edited. Its notes and repetitions should follow its ID. Undo the move, then save against a stale server revision and ask the editor to reload or resolve the conflict rather than discarding a newer plan.
Sources
Technical references checked .



