feat: indicateur versioning sur cartes + toolbar éditeur
Note card: - Icône History en overlay bottom-right (visible si historyEnabled=true) - Discrète: text-muted-foreground/50, ne pollue pas l'UI - Tooltip 'Historique des versions activé' Toolbar éditeur: - Icône History à côté du statut Saved/Dirty - Visible seulement en sm+ (desktop) - cursor-help + tooltip i18n: - notes.historyEnabledTooltip ajouté aux 15 locales (FR/EN traduits, 13 EN placeholder)
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
||||
AlertDialogHeader,
|
||||
AlertDialogTitle,
|
||||
} from '@/components/ui/alert-dialog'
|
||||
import { Pin, Bell, GripVertical, X, Link2, FolderOpen, StickyNote, LucideIcon, Folder, Briefcase, FileText, Zap, BarChart3, Globe, Sparkles, Book, Heart, Crown, Music, Building2, LogOut, Trash2, AlignLeft, FileCode2, PenLine, ListChecks, ChevronRight, Plus } from 'lucide-react'
|
||||
import { Pin, Bell, GripVertical, X, Link2, FolderOpen, StickyNote, LucideIcon, Folder, Briefcase, FileText, Zap, BarChart3, Globe, Sparkles, Book, Heart, Crown, Music, Building2, LogOut, Trash2, AlignLeft, FileCode2, PenLine, ListChecks, ChevronRight, Plus, History } from 'lucide-react'
|
||||
import { useState, useEffect, useTransition, useOptimistic, memo, useMemo } from 'react'
|
||||
import dynamic from 'next/dynamic'
|
||||
import { useSession } from 'next-auth/react'
|
||||
@@ -594,6 +594,16 @@ export const NoteCard = memo(function NoteCard({
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Versioning indicator */}
|
||||
{optimisticNote.historyEnabled && (
|
||||
<div
|
||||
className="absolute bottom-3 end-3 z-10"
|
||||
title={t('notes.historyEnabledTooltip') || 'Version history enabled'}
|
||||
>
|
||||
<History className="h-3.5 w-3.5 text-muted-foreground/50" />
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Fusion Badge */}
|
||||
{note.aiProvider === 'fusion' && optimisticNote.autoGenerated !== null && (
|
||||
<div className="px-1.5 py-0.5 rounded text-[10px] font-medium bg-purple-100 dark:bg-purple-900/30 text-purple-700 dark:text-purple-400 border border-purple-200 dark:border-purple-800 flex items-center gap-1 group/badge relative mb-2 w-fit">
|
||||
|
||||
@@ -19,7 +19,7 @@ import { Badge } from '@/components/ui/badge'
|
||||
import {
|
||||
X, Plus, Palette, Image as ImageIcon, Bell, Eye, Link as LinkIcon, Sparkles,
|
||||
Maximize2, Copy, ArrowLeft, ChevronRight, PanelRight, Check, Loader2, Save, MoreHorizontal,
|
||||
Trash2, LogOut, Wand2, Share2, Wind, Paperclip, GraduationCap, FileDown, FileUp, Mic, MicOff, Printer, PenTool, Loader2 as Loader2Icon, Globe, ExternalLink
|
||||
Trash2, LogOut, Wand2, Share2, Wind, Paperclip, GraduationCap, FileDown, FileUp, Mic, MicOff, Printer, PenTool, Loader2 as Loader2Icon, Globe, ExternalLink, History
|
||||
} from 'lucide-react'
|
||||
import { FlashcardGenerateDialog } from '@/components/flashcards/flashcard-generate-dialog'
|
||||
import { NoteShareDialog } from './note-share-dialog'
|
||||
@@ -549,6 +549,15 @@ export function NoteEditorToolbar({ mode, onClose, onToggleAttachments, attachme
|
||||
: <><Check className="h-3 w-3 text-emerald-500" /><span>{t('notes.savedStatus')}</span></>}
|
||||
</span>
|
||||
|
||||
{note.historyEnabled && (
|
||||
<span
|
||||
className="hidden sm:flex items-center gap-1 text-[11px] text-foreground/35 select-none cursor-help"
|
||||
title={t('notes.historyEnabledTooltip') || 'Version history enabled'}
|
||||
>
|
||||
<History className="h-3 w-3" />
|
||||
</span>
|
||||
)}
|
||||
|
||||
{state.isMarkdown && !readOnly && (
|
||||
<button
|
||||
title={state.showMarkdownPreview ? t('notes.markdownEditingTitle') : t('notes.markdownPreviewTitle')}
|
||||
|
||||
Reference in New Issue
Block a user