Skip to content

feat: add simple versioning + sandbox mode#3373

Merged
forestileao merged 15 commits intomainfrom
feat/versioning-with-publish
Mar 5, 2026
Merged

feat: add simple versioning + sandbox mode#3373
forestileao merged 15 commits intomainfrom
feat/versioning-with-publish

Conversation

@forestileao
Copy link
Collaborator

@forestileao forestileao commented Mar 5, 2026

Summary

This PR implements the scoped canvas versioning system end-to-end across backend, frontend, and CLI, and removes extra POC behavior that was out of scope (BY NOW).

The flow is now intentionally simple:

  • Canvas structure lives in versions.
  • Each canvas has one live_version.
  • Each user has one draft version.
  • Change request creation snapshots the current draft and publishes it.
  • Sandbox mode bypasses versioning and edits live directly.

Backend

  • Moved canvas nodes and edges ownership to canvas versions.
  • Updated canvas model so it keeps only a non-null live_version_id relation.
  • Implemented per-user unique DRAFT version behavior.
  • Simplified change request model/flow:
    • Kept only create/publish flow required by product scope.
    • Change request stores title, description, and snapshot_version from draft at creation time.
  • Removed non-required conflict/version-control complexity:
    • no base version/revision conflict flow.
    • removed extra RPCs/handlers that were not requested (close/resolve/sync/discard APIs).
  • Added/updated authorization for only the required versioning endpoints.
  • Added sandbox mode support in backend behavior:
    • when sandbox is disabled, live update requires version flow.
    • when sandbox is enabled, live direct updates are allowed.

Frontend

  • Brought in the versioning sidebar behavior (without bringing the separate versioning page flow).
  • Create Change Request action now opens modal and publishes directly from there.
  • Added history UX for live/current + past published versions.
  • History actions now use explicit icon actions:
    • open/view version
    • open diff modal against previous version
  • Reworked diff UI to GitHub-style component rendering (react-diff-view) and removed earlier custom/terminal-like output.
  • Diff modal now shows change request metadata (title + markdown-rendered description) and uses larger dimensions.
  • Updated header/edit-mode behavior:
    • versioning mode: explicit edit entry, save state dropdown, autosave toggle, save/undo actions, discard/exit edit actions.
    • sandbox mode: warning label + versioning disabled behavior.
    • added “Pending Draft” warning when draft differs from live outside edit mode.
  • Fixed dropdown interaction behavior to close on internal actions.
  • Ensured canvas data refreshes correctly when re-entering live/version context.

CLI

  • Kept sandbox mode API behavior backward-compatible for canvases update.
  • Added non-sandbox versioning flow:
    • require draft flow for updates (instead of direct live updates),
    • support publish command from draft/versioning flow.
  • Added explicit error when trying to update live canvas while org is not in sandbox mode.

Migrations / Data Model

  • Reworked migrations to match scoped design (clean implementation, no POC leftovers).
  • Ensured schema aligns with required behavior only (no conflict/revision columns).

Tests / Fixes

  • Updated failing tests to new versioned canvas structure (live_version instead of direct canvas.edges/nodes).
  • Fixed unit/e2e breakages caused by live_version_id non-null requirements.
  • Updated related setup/fixtures to create valid live versions for canvases.

Scope Control

  • Removed features and API surface not requested in the original scope.
  • Kept implementation focused on required versioning behavior only.

Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@superplanehq-integration
Copy link

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes 3m)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao forestileao changed the title Feat/versioning with publish feat: add simple versioning + sandbox mode Mar 5, 2026
@forestileao
Copy link
Collaborator Author

/sp start

@superplanehq-integration
Copy link

This action is only available to maintainers.

Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao forestileao marked this pull request as ready for review March 5, 2026 05:05
forestileao and others added 6 commits March 5, 2026 02:05
…q/superplane into feat/versioning-with-publish
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
Signed-off-by: Pedro F. Leao <pedroforestileao@gmail.com>
@forestileao forestileao merged commit 2aa05bf into main Mar 5, 2026
3 checks passed
@forestileao forestileao deleted the feat/versioning-with-publish branch March 5, 2026 17:14
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