WPS / egon.io

A tool to visualize Domain Stories in your browser
http://domainstorytelling.org
750 stars 105 forks source link

Creating overlapping groups breaks .egn and .egn.svg files #158

Closed hofstef closed 1 month ago

hofstef commented 2 months ago

Describe the bug Creating a group on top of another group breaks the export: The JSON contains the second group twice (with the same ID). This causes the import to fail.

This bug only happens when the second group is created while the mouse is within another group:

overlapping-groups

(the mouse cursor is not shown in this sceenshot, but you can see that the first group - named "1" - is highlighted because the mouse is hovering over it)

To Reproduce Steps to reproduce the behavior:

  1. Click on 'Group' in the palette and place it on the canvas.
  2. Click on 'Group' in the palette and move the mouse so that the preview of the new group overlaps with the existing group and that the mouse cursor hovers over the first group.
  3. Click on the canvas to create a second group that overlaps with the first one.
  4. Export as .egn or .egn.svg
  5. The JSON contains 3 groups: The first one, the second one and a duplicate of the second one. See for example attached file.
  6. Import the .egn or egn.svg and open the browser console: The import will fail and stop after it has encountered the element with the duplicate ID.

2 groups intersect a lot - broken egn

Screenshots [If applicable, add screenshots to help explain your problem.]

Version

DanielHeckert commented 2 months ago

Should we repair the import for already broken svg- or eng files regarding to the duplicates?

hofstef commented 2 months ago

I don't think that this is necessary as this bug did exist for a short time only and only occured under very specific circumstances. Also, broken .egn and .egn.svg files can be easily fixed manually by deleting the duplicate group.

hofstef commented 1 month ago

fixed with v2.2.0