fix(ui): sélection groupée dans la boîte de réception
Permet de cocher plusieurs notes, les déplacer vers un carnet ou les envoyer à la corbeille, et rend la carte mentale plus lisible. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -25,6 +25,7 @@ import { useNotebooks } from '@/context/notebooks-context'
|
||||
import { toast } from 'sonner'
|
||||
import { ConfirmDeleteNoteDialog } from '@/components/confirm-delete-note-dialog'
|
||||
import { showNoteTrashedToast } from '@/lib/notes/trash-toast'
|
||||
import { NoteSelectCheckbox } from '@/components/note-select-checkbox'
|
||||
import { fr } from 'date-fns/locale/fr'
|
||||
import { enUS } from 'date-fns/locale/en-US'
|
||||
import { formatAbsoluteDateLocalized } from '@/lib/utils/format-localized-date'
|
||||
@@ -37,6 +38,10 @@ type NotesEditorialViewProps = {
|
||||
onOpen: (note: Note, readOnly?: boolean) => void
|
||||
notebookName?: string
|
||||
onOpenHistory?: (note: Note) => void
|
||||
selection?: {
|
||||
selectedIds: ReadonlySet<string>
|
||||
onToggle: (id: string) => void
|
||||
}
|
||||
} & NoteCollectionActions
|
||||
|
||||
function formatNoteDate(date: Date | string, language: string): string {
|
||||
@@ -376,6 +381,7 @@ export function NotesEditorialView({
|
||||
onMoveToNotebook,
|
||||
onNotePatch,
|
||||
onNoteIllustrationGenerated,
|
||||
selection,
|
||||
}: NotesEditorialViewProps) {
|
||||
const { t, language } = useLanguage()
|
||||
const { data: session } = useSession()
|
||||
@@ -454,7 +460,14 @@ export function NotesEditorialView({
|
||||
</div>
|
||||
|
||||
<h2 className="font-memento-serif text-2xl font-medium text-foreground flex items-center gap-2 justify-between">
|
||||
<span className="inline-flex items-center gap-2 truncate">
|
||||
<span className="inline-flex items-center gap-2 truncate min-w-0">
|
||||
{selection && (
|
||||
<NoteSelectCheckbox
|
||||
checked={selection.selectedIds.has(note.id)}
|
||||
onToggle={() => selection.onToggle(note.id)}
|
||||
label={t('notes.selectNote')}
|
||||
/>
|
||||
)}
|
||||
{note.isPinned && <Pin size={14} className="text-amber-500 fill-amber-500 shrink-0" />}
|
||||
{note.historyEnabled && <History size={14} className="text-emerald-500 shrink-0" />}
|
||||
{title}
|
||||
|
||||
Reference in New Issue
Block a user