feat: add AI-powered notebook organization with preview dialog
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m24s

This commit is contained in:
Antigravity
2026-05-10 18:52:05 +00:00
parent 330c0c61b6
commit 6123dcfba4
3 changed files with 713 additions and 0 deletions

View File

@@ -42,6 +42,10 @@ const NotebookSummaryDialog = dynamic(
() => import('@/components/notebook-summary-dialog').then(m => ({ default: m.NotebookSummaryDialog })),
{ ssr: false }
)
const OrganizeNotebookDialog = dynamic(
() => import('@/components/organize-notebook-dialog').then(m => ({ default: m.OrganizeNotebookDialog })),
{ ssr: false }
)
type InitialSettings = {
showRecentNotes: boolean
@@ -88,6 +92,7 @@ export function HomeClient({ initialNotes, initialSettings }: HomeClientProps) {
const [autoLabelOpen, setAutoLabelOpen] = useState(false)
const [summaryDialogOpen, setSummaryDialogOpen] = useState(false)
const [createSubNotebookOpen, setCreateSubNotebookOpen] = useState(false)
const [organizeNotebookOpen, setOrganizeNotebookOpen] = useState(false)
const [selectedTagIds, setSelectedTagIds] = useState<string[]>([])
const [isTagsExpanded, setIsTagsExpanded] = useState(false)
const [tagSearchQuery, setTagSearchQuery] = useState('')
@@ -591,6 +596,17 @@ export function HomeClient({ initialNotes, initialSettings }: HomeClientProps) {
<span>{t('notes.reorganize') || 'Réorganiser les notes'}</span>
</button>
)}
{currentNotebook && initialSettings.aiAssistantEnabled && (
<button
onClick={() => setOrganizeNotebookOpen(true)}
className="flex items-center gap-2 text-[13px] text-blueprint font-medium hover:opacity-70 transition-opacity"
title="Organiser ce carnet avec l'IA"
>
<Sparkles size={16} />
<span>Organiser</span>
</button>
)}
</div>
<div className="flex items-center gap-6">
{searchParams.get('notebook') && (
@@ -804,6 +820,15 @@ export function HomeClient({ initialNotes, initialSettings }: HomeClientProps) {
parentNotebookId={searchParams.get('notebook')}
/>
)}
{currentNotebook && (
<OrganizeNotebookDialog
open={organizeNotebookOpen}
onOpenChange={setOrganizeNotebookOpen}
notebookId={currentNotebook.id}
notebookName={currentNotebook.name}
onDone={() => router.refresh()}
/>
)}
</div>
)
}