FE-502, H-6330: Improve SDCPN file import/export and file save/open behaviour#8536
FE-502, H-6330: Improve SDCPN file import/export and file save/open behaviour#8536
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
PR SummaryMedium Risk Overview Fixes imports of files missing visual info by defaulting absent arrays/visual fields (including missing Improves net switching UX by adding Written by Cursor Bugbot for commit e31b652. This will update automatically on new commits. Configure here. |
🤖 Augment PR SummarySummary: This PR refactors Petrinaut’s SDCPN JSON import/export to be versioned and Zod-validated, and improves the import experience when node positions are missing. Changes:
Technical Notes: The new importer prefers the versioned schema first, falls back to the legacy schema, and uses user settings (compact vs classic node dimensions) when computing ELK layout. 🤖 Was this summary useful? React with 👍 or 👎 |
82c0b1c to
5cb778f
Compare
7889b18 to
1a404fc
Compare
5cb778f to
9d9196d
Compare
- Fix export spread order so explicit title cannot be overwritten - Fix stale closure in loadPetriNet by moving check inside updater - Show actual Zod errors for supported version with invalid structure - Split hasMissingPositions from type visual info check - Remove pre-2025-11-28 old format import support - Add 19 unit tests for parseSDCPNFile Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove old-formats directory and all related exports/types - Simplify localStorage types (no more OldFormat union) - Remove old format conversion logic from init effect - Remove onlyMissingPositions from calculateGraphLayout, always do full layout Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


🌟 What is the purpose of this PR?
Fixes the bug where importing an SDCPN file exported without visual info breaks the editor. Also improves the file format with Zod validation and a versioned envelope. Additionally improves the File menu save/open behaviour.
🔗 Related links
🔍 What does this change?
src/file-format/(export-sdcpn,import-sdcpn,remove-visual-info)old-format(before November 2025)clipboard/types.tsversion,meta.generator) to exported filesx/y, runs ELK layout before callingcreateNewNet(avoids a stale closure bug where positions were applied to the wrong net)onlyMissingPositionsoption tocalculateGraphLayoutfor partial re-layout of imported nodesImportErrorDialogshowing Zod validation errors with a "Create empty net" fallbacklastUpdatedon mutation so the sort order reflects actual edit activityPre-Merge Checklist 🚀
🚢 Has this modified a publishable library?
This PR:
📜 Does this require a change to the docs?
The changes in this PR:
🕸️ Does this require a change to the Turbo Graph?
The changes in this PR:
❓ How to test this?