Skip to content

Implement version history (git-like undo/redo across sessions) #13

Description

@espetro

TL;DR

Add version history that persists across sessions, enabling undo/redo beyond the current session and branching exploration of design variations. Git-like for designers.

User Story

As a user, I want to browse previous versions of my design and restore them, so I can experiment without fear of losing work.

Scope

  • Git-like commit model: snapshot project state at meaningful points
  • Timeline view: browse history and restore previous states
  • Branch/merge: explore variations without losing main thread
  • Auto-commit: snapshots before major AI generation
  • Commit messages: optional annotations for changes

Tradeoffs / Optionality

Storage Model

Full Snapshots (simpler):

  • Pros: Easy to implement, fast restore
  • Cons: Storage grows quickly, inefficient

Delta Compression (efficient):

  • Pros: Minimal storage, like git
  • Cons: Complex implementation, slower restore

Decision: Start with full snapshots. Add delta compression when storage becomes an issue.

Linear vs Branching History

Linear (MVP):

  • Pros: Simple UI, easy to understand
  • Cons: No parallel experimentation

Branching (P2):

  • Pros: True git-like workflow, explore variations
  • Cons: Complex UI, merge conflicts

Decision: Linear for MVP. Branching is a P2 enhancement.

Technical Considerations

  • Storage: SQLite blob column for snapshots
  • Trigger Points:
    • Before AI generation (auto-commit)
    • User explicit save
    • After successful export
  • Performance:
    • Serialize canvas state (frames, positions, comments)
    • Compress with zlib or pako
    • Lazy-load history (only load metadata, not full snapshots)
  • UI: Timeline sidebar with commit messages, timestamps, thumbnails
  • Dependencies: Database persistence (Implement SQLite database layer with Drizzle ORM #10), canvas state serialization

References

  • Original spec: docs/prd-v2.md P2+ (Version History)
  • Canvas undo/redo: docs/roadmap/canvas-enhancements.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions