Skip to content

Circuit checkpoint / version history system #350

@darktorres

Description

@darktorres

Description

Add a non-destructive versioning system (like Git for circuits) that lets users create named checkpoints, browse history, and branch into alternative designs without losing previous work.

Features

  • Manual named checkpoints ("before adding ALU", "working version")
  • Auto-checkpoints at configurable intervals
  • Visual timeline of checkpoints
  • Restore any checkpoint without losing later ones

Acceptance Criteria

  • Intuitive UI for creating and browsing checkpoints
  • Performance is not impacted during normal editing
  • Storage is efficient (compression, deduplication of unchanged elements)

Implementation Guide

1. Checkpoint storage

  • Each checkpoint is a serialized snapshot of the circuit (use existing Serialization::serialize())
  • Store as compressed blobs (qCompress) in a sidecar file (e.g., .panda.history) or embedded in the .panda metadata
  • Delta compression: store only changed elements relative to previous checkpoint (optional optimization)

2. Checkpoint manager

  • Create CheckpointManager class owned by WorkSpace
  • Methods: createCheckpoint(name), restoreCheckpoint(index), listCheckpoints()
  • Auto-checkpoint: connect to Scene::circuitHasChanged with a debounce timer

3. UI

  • Add a checkpoint panel (dockable widget or sidebar)
  • Show timeline with checkpoint names and timestamps
  • Double-click to restore, right-click for rename/delete
  • Add toolbar button for quick checkpoint creation

4. Integration with undo stack

  • Checkpoints are independent of QUndoStack — they capture full state, not incremental commands
  • Restoring a checkpoint clears the undo stack and loads the snapshot

Key files

  • App/Scene/Workspace.h/.cpp — file management, save/load
  • App/IO/Serialization.h/.cpp — circuit serialization
  • App/UI/MainWindow.cpp — UI integration
  • New files: App/Scene/CheckpointManager.h/.cpp, App/UI/CheckpointPanel.h/.cpp

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions