Skip to content

feat(automation): add version history panel to canvas editor - #3800

Draft
ppatel9703 wants to merge 4 commits into
devfrom
feat-automation-version-history
Draft

ppatel9703 wants to merge 4 commits into
devfrom
feat-automation-version-history

Conversation

@ppatel9703

@ppatel9703 ppatel9703 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a Developer Mode version-history dialog to the Automation canvas, backed by the project-Git APIs in SEMOSS/Semoss#3200.

Users can inspect saved revisions and, when authorized, restore one after explicit confirmation. The canvas then reloads the server-validated aggregate. Restoring creates a new saved version; it does not rewind Git history.

Flow

flowchart LR
    Design[Design Mode] --> Hidden[Version history hidden]
    Dev[Developer Mode] --> Open[Open version history]
    Open --> List[List up to 100 revisions]
    List --> Select[Select revision]
    Select --> Confirm[Confirm restore]
    Confirm --> API[RollbackAutomation with expected revision]
    API --> Refresh[Clear stale run state and reload canvas]
Loading

Changes

  • Adds typed frontend clients for listing versions and restoring a selected revision.
  • Validates backend response shapes before rendering or accepting a restore.
  • Shows the Version History control only in Developer Mode and closes it when Developer Mode is disabled.
  • Supports read-only history inspection while disabling restore without edit capability.
  • Disables history/restore while the workflow is loading or otherwise in an unsafe editor state.
  • Requires the current definition revision when restoring to protect against stale edits.
  • Warns when unsaved canvas changes would be discarded.
  • Uses a bounded scroll region, compact revision identifiers, readable restore messages, and full revision identifiers in accessible metadata.
  • Handles loading, empty, retry, failure, confirmation, pending, and cancel states.
  • Prevents duplicate submission and dismissal while a restore is pending.
  • Ignores stale list responses after switching projects.
  • Restores focus to the selected history entry when confirmation is canceled.
  • Clears stale run/canvas state and reloads the saved definition after a successful restore.

UI behavior

Design Mode                      Developer Mode
--------------------------       ----------------------------
Version History hidden           Version History available
                                 List saved revisions
                                 Select -> confirm -> restore
                                 Reload refreshed definition

Tests

Automation frontend regression suite:

  • 20 test files passed.
  • 115 tests passed.
  • Focused coverage includes Dev Mode visibility, disabled states, response validation, empty history, retry, restore confirmation, cancellation, stale requests, missing current revision, pending-state locking, compact revision display, and focus restoration.

Manual internal-browser validation confirmed:

  • Design Mode hides the Version History control.
  • Developer Mode reveals it and persists correctly after a cache-cleared reload.
  • The dialog displays correct 2026 timestamps, compact SHAs, and readable restore messages.
  • Keyboard dismissal and restore confirmation/cancel work.
  • Cancel returns focus to the selected revision.
  • The history request returned HTTP 200 and completed in 35 ms server time.
  • No console errors or warnings were produced by the version-history flow.
  • No Automation was modified during the browser test.

@semoss/automation type-check remains blocked by existing unrelated errors in shared audit-log and in-progress Automation files; this PR's touched files were clean under Biome and produced no new type-check diagnostics.

Reviewer test

  1. Build the UI with the paired backend PR running.
  2. Open an Automation in Design Mode and confirm Version History is hidden.
  3. Switch to Developer Mode and open Version History.
  4. Confirm dates, messages, and shortened revision identifiers render cleanly.
  5. Select a revision, cancel, and verify focus returns to that revision.
  6. On a disposable Automation, confirm restore and verify the canvas reloads the selected definition.
  7. Disable Developer Mode and confirm the control is removed.
  8. With view-only access, verify history is inspectable but restore is disabled.

Out of scope

  • Editing Git commits or branches from the UI.
  • Run-history restoration.
  • BPMN, FEEL, and unrelated canvas changes.

@snyk-io

snyk-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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