feat(folders-editor): drag entire folder block as single unit (#38122)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Kamil Gabryjelski
2026-02-27 20:02:21 +01:00
committed by GitHub
parent 5e890a8cf7
commit 63f1d9eb98
13 changed files with 700 additions and 34 deletions

View File

@@ -61,6 +61,7 @@ export interface VirtualizedTreeItemData {
metricsMap: Map<string, Metric>;
columnsMap: Map<string, ColumnMeta>;
activeId: UniqueIdentifier | null;
draggedFolderChildIds: Set<string>;
forbiddenDropFolderIds: Set<string>;
currentDropTargetId: string | null;
onToggleCollapse: (id: string) => void;
@@ -151,6 +152,7 @@ function VirtualizedTreeItemComponent({
metricsMap,
columnsMap,
activeId,
draggedFolderChildIds,
forbiddenDropFolderIds,
currentDropTargetId,
onToggleCollapse,
@@ -185,6 +187,12 @@ function VirtualizedTreeItemComponent({
);
}
// Hidden descendants of the dragged folder — not droppable.
// handleDragEnd uses lastValidOverIdRef when dropping in this dead zone.
if (draggedFolderChildIds.has(item.uuid)) {
return <div style={{ ...style, visibility: 'hidden' }} />;
}
const childCount = isFolder ? (folderChildCounts.get(item.uuid) ?? 0) : 0;
const showEmptyState = isFolder && childCount === 0;