Skip to content

Add JSON export and import to toolbar#6

Merged
tmcfarlane merged 2 commits into
feature/export-to-giffrom
feature/export-to-json
Apr 13, 2026
Merged

Add JSON export and import to toolbar#6
tmcfarlane merged 2 commits into
feature/export-to-giffrom
feature/export-to-json

Conversation

@tmcfarlane
Copy link
Copy Markdown
Owner

@tmcfarlane tmcfarlane commented Apr 12, 2026

Summary

  • Add "Import from JSON" option at the top of the export dropdown — opens a native file picker for .json files
  • Add "Export as JSON" option — downloads the current flowchart as flowchart.json with the full { nodes, edges } structure
  • Graceful error handling for invalid imports with inline error messages (invalid JSON, missing nodes/edges arrays, malformed node data)
  • Import saves history before replacing the flowchart, so users can undo

Test plan

  • TypeScript compiles with no errors
  • All 20 existing tests pass
  • Production build succeeds
  • Export a flowchart as JSON, verify the downloaded file contains valid nodes/edges
  • Import the exported JSON, verify the flowchart renders correctly
  • Import an invalid file (e.g., a text file renamed to .json), verify a friendly error appears
  • Import a JSON missing the "nodes" key, verify error message
  • After importing, verify undo restores the previous flowchart

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flowchart Ready Ready Preview, Comment Apr 13, 2026 2:42am

@tmcfarlane tmcfarlane merged commit 5c04782 into feature/export-to-gif Apr 13, 2026
2 checks passed
@tmcfarlane tmcfarlane deleted the feature/export-to-json branch April 13, 2026 04:11
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.

1 participant