Kruptein / PlanarAlly

A companion tool for when you travel into the planes.
https://www.planarally.io/
MIT License
400 stars 73 forks source link

[BUG] Undoing shape removal does not reattach shape to notes #1416

Open rexy712 opened 7 months ago

rexy712 commented 7 months ago

Describe the bug When deleting a shape, any notes the shape was attached to lose that attachment. Performing an undo action should reattach them presumably, but it does not. The client never sees the shape removed from the note's list of attached shapes, so it appears to reattach until refreshed. The server, however, sees the attached shape removed from the note when the shape was deleted.

To Reproduce Steps to reproduce the behavior:

  1. Create a shape, attach note to it.
  2. Delete the shape.
  3. Ctrl+Z to undo the deletion.
  4. The note appears to reattach on the client until a refresh.
  5. After refresh, the shape shows it is truly not attached to the note.

Expected behavior Notes reattach shapes when undoing a shape removal.

Screenshots

https://github.com/Kruptein/PlanarAlly/assets/2442544/12558368-c2b9-49ec-8105-6f6aa67ac41f

Desktop:

Kruptein commented 6 months ago

The UI not updating properly has been fixed.

The core of the issue however is more difficult to tackle as the information of which notes were attached to the shape are gone by the time the undo action is triggered.

This information will have to be added to the undo-stack info, but there probably is more info that is lost that should be added. (e.g. group information)