feat(lists): allow nested sidebar folders via drag and drop
Folders can now contain other folders, to arbitrary depth, via a self-referencing parent_folder_id (ON DELETE SET NULL, same pattern as lists.folder_id). Nesting/un-nesting is drag-and-drop only: dropping a folder onto another folder's header middle moves it in, the outer quarters or any top-level/in-folder drop insert it beside a target. Dropping a folder into itself or one of its own subfolders is silently ignored. Deleting a folder releases its lists and subfolders back to the top level, unchanged from the existing list behavior. ListFolderNavItemViewModel.Lists became Children (object, mixing lists and subfolders, mirroring TopLevel) so the existing implicit, type-matched DataTemplates render nested folders recursively without new XAML, and each nesting level gets its indent for free from the folder template's own margin. Folders/RootLists/ContainerOf/PersistOrderAsync/RecomputeFolderCounts now walk the tree instead of assuming one level. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
352aaa525b
commit
0dac047c46
@@ -17,7 +17,14 @@ public class ListFolderEntityConfiguration : IEntityTypeConfiguration<ListFolder
|
||||
builder.Property(f => f.Icon).HasColumnName("icon");
|
||||
builder.Property(f => f.SortOrder).HasColumnName("sort_order").IsRequired().HasDefaultValue(0);
|
||||
builder.Property(f => f.IsCollapsed).HasColumnName("is_collapsed").IsRequired().HasDefaultValue(false);
|
||||
builder.Property(f => f.ParentFolderId).HasColumnName("parent_folder_id");
|
||||
|
||||
builder.HasIndex(f => f.SortOrder).HasDatabaseName("idx_list_folders_sort");
|
||||
builder.HasIndex(f => f.ParentFolderId).HasDatabaseName("idx_list_folders_parent");
|
||||
|
||||
builder.HasOne<ListFolderEntity>()
|
||||
.WithMany()
|
||||
.HasForeignKey(f => f.ParentFolderId)
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user