Skip to content

Fix: Restore floor drag/delete functionality for imported legacy JSON…#413

Open
ruok-dev wants to merge 1 commit into
pascalorg:mainfrom
ruok-dev:main
Open

Fix: Restore floor drag/delete functionality for imported legacy JSON…#413
ruok-dev wants to merge 1 commit into
pascalorg:mainfrom
ruok-dev:main

Conversation

@ruok-dev

Copy link
Copy Markdown
Contributor

Fixes #398

Refactored migrateNodes() into a two-pass migration process and added normalization for level nodes. Elevator parent migration now runs only after all level-child relationships are stabilized, preventing invalid hierarchy reconstruction when importing legacy JSON files.

This restores normal floor operations (dragging, reordering, and deletion) for projects imported from versions prior to 0.9.1.

… files

Summary

Fixed an issue where floors became impossible to drag or delete after importing JSON configuration files created in versions prior to 0.9.1.

Root Cause

The migration process was executing elevator parent migration before all level nodes had their children fully normalized. As a result, imported scenes could end up with inconsistent parent-child relationships, causing floor management operations such as dragging and deletion to fail.

Changes Made
Refactored migrateNodes() into a two-pass migration process.
Added normalization for level nodes:
Ensures level values are valid finite numbers.
Removes references to missing child nodes.
Preserves only valid children during migration.
Moved elevator migration logic to a dedicated second pass:
Elevator parent migration now runs only after all level.children relationships have been stabilized.
Prevents invalid hierarchy reconstruction when importing legacy JSON files.
Result

Imported layouts from versions prior to 0.9.1 now correctly preserve floor hierarchy, allowing floors to be dragged, reordered, and deleted as expected.
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.

Bug: Unable to drag or delete floors after importing JSON from version 0.9.1 onwards

1 participant