Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix merge issue with nested layouts #340

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

loreanvictor
Copy link
Contributor

Checklist

  • I documented the TypeScript code using JSDoc style (NA).
  • I added multiple screenshots/screencasts of my UI changes
  • I translated all the newly inserted strings into German and English (NA)

Motivation and Context

There was an issue with merging two states wherein layout information for nested elements wouldn't be recalculated properly.

Description

While merging two states, elements that used to have a parent in the old state but are without a parent in the new state wouldn't be calculated properly. This is used by the client for quickly accessing the root elements for rendering, and while it triggers on its own as a result of re-renders and layout updates, it sometimes caused elements to vanish momentarily after state merges (e.g. during realtime collaboration).

Steps for Testing

  1. Clone Apollon standalone and link local Apollon.
  2. Create a diagram and open it in collaboration mode in another browser window.
  3. Create a class element and a package element.
  4. Drag the class element inside the package, then drag it back outside.
  5. Without this fix, it is possible that the class will vanish. With this fix, this won't happen.

Test Coverage

File Branch Line
components/store/merge.ts 100% 100%

Screenshots

Without this fix:

ScreenRecording2024-01-22at07 53 16-ezgif com-video-to-gif-converter

With this fix:

ScreenRecording2024-01-22at07 55 04-ezgif com-video-to-gif-converter

@matthiaslehnertum matthiaslehnertum merged commit 88338a9 into develop Jan 28, 2024
5 checks passed
@matthiaslehnertum matthiaslehnertum deleted the bugfix/nested-layout-merge-issue branch January 28, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants