feat: MVP-5 Sprint 1 - Backup/Restore system

- Add backup types and RecallBackup format
- Create backup snapshot engine (createBackupSnapshot)
- Add IndexedDB storage for local backups
- Implement retention policy (max 10, 30-day cleanup)
- Add backup validation and restore logic (merge/replace modes)
- Add backup restore UI dialog with preview and confirmation
- Add unsaved changes guard hook
- Integrate backups section in Settings
- Add backup endpoint to export-import API
This commit is contained in:
2026-03-22 18:16:36 -03:00
parent 544decf4ac
commit 8c80a12b81
14 changed files with 1824 additions and 5 deletions
+17 -1
View File
@@ -1,10 +1,11 @@
'use client'
import { useState, useRef } from 'react'
import { Download, Upload } from 'lucide-react'
import { Download, Upload, History } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'
import { toast } from 'sonner'
import { BackupList } from '@/components/backup-list'
function parseMarkdownToNote(content: string, filename: string) {
const lines = content.split('\n')
@@ -144,6 +145,21 @@ export default function SettingsPage() {
</Button>
</CardContent>
</Card>
<Card>
<CardHeader>
<CardTitle className="flex items-center gap-2">
<History className="h-5 w-5" />
Backups
</CardTitle>
<CardDescription>
Restaura notas desde backups guardados localmente en tu navegador.
</CardDescription>
</CardHeader>
<CardContent>
<BackupList />
</CardContent>
</Card>
</div>
</main>
)