Skip to content

Comments

feat: Add YAML import when creating a Canvas#3076

Open
harxhist wants to merge 4 commits intosuperplanehq:mainfrom
harxhist:feat/import-canvas-from-yaml
Open

feat: Add YAML import when creating a Canvas#3076
harxhist wants to merge 4 commits intosuperplanehq:mainfrom
harxhist:feat/import-canvas-from-yaml

Conversation

@harxhist
Copy link
Contributor

Summary

Closes #1725

Adds the ability to create a Canvas by importing from a YAML file on the Create Canvas page (/canvases/new).

  • New YAML parsing utility (parseCanvasYaml.ts) that accepts both:
    • The UI export format
    • The CLI resource format (apiVersion / kind: "Canvas")
  • Tabbed UI ("Create manually" / "Import from YAML") with:
    • Paste support
    • File upload
    • Inline validation
    • Editable name/description after parsing
  • No backend changes required — the existing CreateCanvas API already supports a full canvas spec with nodes and edges.

Video Demo: Loom

How it works

The user selects the "Import from YAML" tab, then either:

  • Pastes YAML content, or
  • Uploads a .yaml / .yml file

Clicking "Parse YAML" (or uploading a file):

  1. Validates the structure
  2. On success:
    • Pre-fills the name and description fields
    • Stores the parsed nodes and edges

These are passed through the existing useCreateCanvas mutation on submit.

The YAML format matches:

  • The CLI output (superplane get canvas)
  • The dev-mode YAML export in the UI

What changed

File Change
web_src/src/utils/parseCanvasYaml.ts New — shared YAML parser and file reader utility
web_src/src/components/CreateCanvasModal/index.tsx Added "Import from YAML" tab, extracted CanvasFormFields subcomponent, extended submit data type with optional nodes/edges
web_src/src/pages/home/useCreateCanvasModalState.tsx Extended onSubmit to pass through YAML-imported nodes/edges, falling back to template lookup
web_src/src/pages/canvas/CreateCanvasPage.tsx Added same tabbed YAML import flow to the standalone create page

Tests

  • Import valid YAML from UI
  • Validate error handling for malformed YAML
  • Validate error handling for invalid Canvas schema
  • Confirm name/description pre-fill correctly
  • Confirm nodes/edges are correctly passed to CreateCanvas API
  • Confirm manual creation flow remains unaffected

Signed-off-by: Harsh <harxhist@gmail.com>
@cursor
Copy link

cursor bot commented Feb 12, 2026

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 12.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Signed-off-by: Harsh <harxhist@gmail.com>
Signed-off-by: Harsh <harxhist@gmail.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@AleksandarCole AleksandarCole self-assigned this Feb 13, 2026
@AleksandarCole AleksandarCole added the pr:stage-2/3 Needs to pass functional review label Feb 13, 2026
@AleksandarCole AleksandarCole self-requested a review February 13, 2026 09:36
@harxhist
Copy link
Contributor Author

@shiroyasha
Can you please assign this to me & review the PR?
I am working on other issue meanwhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:stage-2/3 Needs to pass functional review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create Canvas from YAML

2 participants