All entries

    Design a Workout Plan Editor with Reorder and Undo

    A workout editor needs stable exercise IDs so reordering never moves a note to the wrong exercise.

    A gym user rearranges workout rows beside an undo control
    Conceptual pixel-art illustration.

    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.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 81
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    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.

    Meet the author
    THE CONVERSATION

    Your side of the story.