feat: indicateur versioning sur cartes + toolbar éditeur
Some checks failed
CI / Lint, Unit Tests & Build (push) Successful in 5m35s
CI / Deploy production (on server) (push) Failing after 3s

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:
Antigravity
2026-06-28 09:45:29 +00:00
parent a1399a3d7b
commit 334fce5fc1
18 changed files with 53 additions and 19 deletions

View File

@@ -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">

View File

@@ -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')}

View File

@@ -282,7 +282,8 @@
"unarchived": "إلغاء الأرشفة",
"uploading": "جاري الرفع...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Entarchiviert",
"uploading": "Wird hochgeladen...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -315,7 +315,8 @@
"createFirst": "Create your first note",
"unarchived": "Unarchived",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Desarchivado",
"uploading": "Subiendo...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "خارج بایگانی",
"uploading": "در حال آپلود...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -321,7 +321,8 @@
"createFirst": "Créez votre première note",
"unarchived": "Désarchivée",
"savedJustNow": "Sauvegardé",
"unsaved": "Non sauvegardé"
"unsaved": "Non sauvegardé",
"historyEnabledTooltip": "Historique des versions activé — les modifications sont suivies"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "अनार्काइव नहीं",
"uploading": "अपलोड हो रहा है...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Dearchiviato",
"uploading": "Caricamento...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "アーカイブ解除",
"uploading": "アップロード中...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "보관 해제됨",
"uploading": "업로드 중...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Gearchiveerd",
"uploading": "Uploaden...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Wycofane z archiwum",
"uploading": "Przesyłanie...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Desarquivado",
"uploading": "Enviando...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "Разархивировано",
"uploading": "Загрузка...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",

View File

@@ -282,7 +282,8 @@
"unarchived": "已取消归档",
"uploading": "上传中...",
"savedJustNow": "Saved",
"unsaved": "Unsaved changes"
"unsaved": "Unsaved changes",
"historyEnabledTooltip": "Version history enabled — changes are tracked"
},
"pagination": {
"previous": "←",