# Undo only your own change on shared pages \(\#195\) · dara/icarus

[View on GitCafe](https://git.cafe/dara/icarus/commit/478f31157081362120376e4415564357ad53ea89)

Repository: [dara/icarus](https://git.cafe/dara/icarus)

Visibility: public

Requested revision: 478f31157081362120376e4415564357ad53ea89

Requested commit: 478f31157081362120376e4415564357ad53ea89

Commit: 478f31157081362120376e4415564357ad53ea89

Tree: 963be51d51130de8dbf46fc7841632b26d0bdd48

Author: Dara Adedeji

Committer: GitHub

## Message

```
Undo only your own change on shared pages (#195)

* Undo only your own change on shared pages

Transactions (view cone and circle conversions, cones dropped on agents,
marker size changes) and bulk clears restored whole-group snapshots on
undo and redo. On a shared page that rolled back anything a teammate had
added or changed since, and live sync then deleted it for everyone.

A transaction is now one undo step made of the per-object changes its
mutation records; a bulk clear is one deletion per cleared object (the
lineup graph change for lineups). Undo and redo apply them to the page as
it is now. Edits write back only the fields they changed, skip objects a
teammate deleted, and stay in history after hydration while a retained
addition or deletion can bring their target back. Strategy settings
changes write only the settings they changed. Utility vision elevation
and custom colour edits record deltas like every other edit, so their
undo survives hydration and earlier undos.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Replay only what each undo and redo actually changed

Review follow-ups for shared-page undo:

- Ability visibility toggles are written toggle by toggle, so undoing
  one toggle keeps a teammate's other toggles.
- Undo and redo return the entry for the opposite stack, built from what
  they did. Taking an object away keeps the copy taken (a teammate's
  edits included) for the step that puts it back; putting back leaves an
  object that is already there alone; a step that changed nothing has no
  inverse. Transactions and clears keep only the changes that took effect.
- Reconciliation recurses into transactions and clears, drops a
  transaction left with no changes, and runs again on the history a
  clear's undo reinstates. Redoing a clear sets aside the history as it
  is at that moment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Replay lineup graph changes by what they actually changed

Undoing or redoing a lineup addition, deletion or clear returned the
original graph action whatever it did. A redo that removed nothing could
then resurrect a lineup a teammate deleted, a redo-undo pair restored the
stored snapshot over a teammate's edits, and an undo that left a
teammate-restored link alone still got a redo that deleted it.

LineUpProvider.replayGraphAction applies the action to the graph as it is
now and returns its exact inverse: the links it took out, as they were,
and the links it put back, as they now are, with their endpoints; null
when nothing changed. Undo, redo and ActionProvider replay all go through
it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
```

## Parents

- [287cbd373f97998e15c3793a8bddd9e7ad6531cb](https://git.cafe/dara/icarus/commit/287cbd373f97998e15c3793a8bddd9e7ad6531cb?format=markdown)

[Source at this commit](https://git.cafe/dara/icarus/tree/478f31157081362120376e4415564357ad53ea89?format=markdown)
