feat(Notes): implement manual ordering for notes, add drag-and-drop functionality, and update related components for reordering

This commit is contained in:
Julien Froidefond
2026-01-06 14:51:12 +01:00
parent 38ccaf8785
commit 2354a353d1
7 changed files with 332 additions and 189 deletions

View File

@@ -13,6 +13,7 @@ import {
ChevronDown,
} from 'lucide-react';
import { createFolder, updateFolder, deleteFolder } from '@/actions/folders';
import { extractEmojis } from '@/lib/task-emoji';
interface FoldersSidebarProps {
folders: Folder[];
@@ -119,6 +120,27 @@ function FolderItem({
<FolderIcon className="w-4 h-4 flex-shrink-0" />
)}
{folder.tagId &&
(() => {
const tag = availableTags.find((t) => t.id === folder.tagId);
if (tag) {
const emojis = extractEmojis(tag.name);
if (emojis.length > 0) {
return (
<span
className="text-base mr-1"
style={{
fontFamily:
'system-ui, -apple-system, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji"',
}}
>
{emojis[0]}
</span>
);
}
}
return null;
})()}
<span className="flex-1 text-sm truncate">{folder.name}</span>
{folder.notesCount !== undefined && folder.notesCount > 0 && (