Skip to content

feat: implement version history #124

Open
@nullcoder

Description

@nullcoder

Description

Add version tracking and restoration using existing VersionSelector.

Priority

MEDIUM - Advanced feature for tracking changes over time.

Tasks

  • Design version storage schema in R2
  • Implement version creation on edits
  • Integrate existing VersionSelector component
  • Add version comparison view
  • Implement version restoration with PIN validation
  • Add version deletion with confirmation
  • Handle version limits (e.g., max 10 versions)
  • Create version metadata structure

Technical Requirements

  • Versions must be stored encrypted with same key
  • Each version needs metadata (timestamp, size, hash)
  • PIN validation required for restoration
  • Implement efficient storage to avoid duplication
  • Support diff view between versions
  • Handle version cleanup for expired gists

Acceptance Criteria

  • Versions are created automatically
  • Users can view version history
  • Restoration works correctly
  • Old versions can be deleted
  • Storage limits are respected
  • Version metadata is accurate
  • Comparison view shows differences clearly
  • PIN validation prevents unauthorized access

Dependencies

Storage Design

interface Version {
  id: string;
  gistId: string;
  versionNumber: number;
  created: string;
  files: EncryptedFile[];
  metadata: {
    totalSize: number;
    fileCount: number;
    description?: string;
  };
}

Implementation Notes

  • Consider using content-addressable storage for efficiency
  • Implement incremental version numbers
  • Add version description field for user notes
  • Consider compression for version storage
  • Implement version pruning strategy

Estimated Time

4-5 days

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature implementationpriority: mediumNormal priorityuiUser interface and components

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions