added discard/save dialog & clear current graph when loading new graph#632
added discard/save dialog & clear current graph when loading new graph#632
Conversation
🦋 Changeset detectedLatest commit: 4671edb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Description
Solves #618
Type of change
How to test this
Create some nodes, then try to load a graph.
Video
PR Type
Enhancement, Bug fix
Description
Added a dialog to save or discard the current graph when uploading a new one.
Implemented a utility to clear and load a new graph file.
Introduced a utility to save the current graph as a JSON file.
Ensured the current graph is cleared before loading a new one.
Changes walkthrough 📝
upload.tsx
Add dialog and logic for graph upload handlingpackages/graph-editor/src/components/toolbar/buttons/upload.tsx
loadGraphandsaveGraphutilities for graph management.graph.
loadGraph.ts
Implement utility to load and clear graphspackages/graph-editor/src/utils/loadGraph.ts
saveGraph.ts
Implement utility to save graphs as JSONpackages/graph-editor/src/utils/saveGraph.ts
metal-jokes-jam.md
Add changeset for graph upload enhancements.changeset/metal-jokes-jam.md