Open
Description
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
- Issue docs: update project documentation and add Claude Code narrative #112 (Edit Flow)
- Existing components:
- VersionSelector
- PasswordInput (for PIN)
- Dialog (for confirmations)
- CodeEditor (for diff view)
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
- Phase 6 Tracking:
docs/PHASE_6_ISSUE_TRACKING.md
(Issue feat: add custom ghost logo branding throughout the site #114) - R2 Storage:
docs/R2_SETUP.md
- Existing VersionSelector component