From a619b82da964b5eb642382696eef9fda405f561d Mon Sep 17 00:00:00 2001 From: argusagent Date: Tue, 17 Mar 2026 19:07:51 -0400 Subject: [PATCH] fix: prevent error when dragging folder onto doc node (fixes #1086) Dragging a folder resource and dropping it onto a doc node passed an invalid (folder -> doc) combination to the moveResource API, which rejected it and surfaced a generic error toast. Add an early return guard: if the dragged resource is a folder and the drop target is a doc, silently ignore the drop instead of attempting an impossible move. --- src/cloud/lib/hooks/sidebar/useCloudDnd.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/cloud/lib/hooks/sidebar/useCloudDnd.ts b/src/cloud/lib/hooks/sidebar/useCloudDnd.ts index 292b694103..9ef279fdf9 100644 --- a/src/cloud/lib/hooks/sidebar/useCloudDnd.ts +++ b/src/cloud/lib/hooks/sidebar/useCloudDnd.ts @@ -90,6 +90,13 @@ export function useCloudDnd() { return } + // A folder cannot be dropped onto a doc — only onto other folders. + // Without this guard the API rejects the move and shows a generic + // "Something wrong happened" error (#1086). + if (draggedResource.type === 'folder' && targetedResource.type === 'doc') { + return + } + try { const originalResourceId = getResourceId(draggedResource) const pos = targetedPosition