Skip to content

Commit 012554c

Browse files
committed
fix: Disable dragging and renaming folders
1 parent a14cbeb commit 012554c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/features/instance/applications/components/ApplicationsSidebar/buildItems.tsx

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,24 @@ function addEntry(
4747
childFileIds.push(childEntry.path);
4848
}
4949
}
50-
items[index] = { index, isFolder: true, children: [...childDirectoryIds, ...childFileIds], data: entry };
50+
items[index] = {
51+
index,
52+
isFolder: true,
53+
children: [...childDirectoryIds, ...childFileIds],
54+
data: entry,
55+
canMove: false,
56+
canRename: false,
57+
} satisfies TreeItem<DirectoryEntry | FileEntry>;
5158
for (const child of dir.entries) {
5259
addEntry(items, child);
5360
}
5461
} else {
55-
items[index] = { index, isFolder: false, data: entry };
62+
items[index] = {
63+
index,
64+
isFolder: false,
65+
data: entry,
66+
canMove: true,
67+
canRename: true,
68+
};
5669
}
5770
}

src/features/instance/applications/components/ApplicationsSidebar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export function ApplicationsSidebar() {
3838
}, [openedEntry, focusedItem, items]);
3939

4040
// TODO: onRenameItem f2 handling
41-
// TODO: on drag item from one folder to another
4241
// TODO: Split all this logic up into smaller files, right?
4342

4443
// TODO: keyboard shortcuts when the editor isn't focused (creating files and folders, deleting, can we
@@ -50,6 +49,7 @@ export function ApplicationsSidebar() {
5049
// TODO: import application
5150

5251
// TODO: context menu when right click on tree
52+
// TODO: on drag item from one folder to another
5353
// TODO: on drop file or folder from outside the editor to upload stuff rapidly
5454
// TODO: open file after creating it
5555
// TODO: select folder after creating it

0 commit comments

Comments
 (0)