feat: MVP-5 Sprint 3 - Sidebar, Work Mode, and Drafts

- Enhance note-connections with collapsible sections and recent versions
- Add work mode toggle in header for focused work
- Add draft autosave with 7-day TTL and recovery banner
- Save drafts on changes for new notes
This commit is contained in:
2026-03-22 18:28:14 -03:00
parent cde0a143a5
commit a40ab18b1b
7 changed files with 225 additions and 18 deletions

View File

@@ -0,0 +1,26 @@
'use client'
import { useState, useEffect } from 'react'
import { getWorkMode, setWorkMode } from '@/lib/work-mode'
import { Button } from '@/components/ui/button'
import { Monitor, Eye } from 'lucide-react'
export function WorkModeToggle() {
const [enabled, setEnabled] = useState(false)
useEffect(() => {
setEnabled(getWorkMode())
}, [])
const toggle = () => {
const newValue = !enabled
setEnabled(newValue)
setWorkMode(newValue)
// Could dispatch custom event for other components to listen
}
return (
<Button variant="ghost" size="sm" onClick={toggle} title="Modo trabajo">
{enabled ? <Eye className="h-4 w-4" /> : <Monitor className="h-4 w-4" />}
</Button>
)
}