From e4c6d4ab5d86d6bb08038548b17103b3b1756d30 Mon Sep 17 00:00:00 2001 From: Nariman Jelveh Date: Sat, 24 Oct 2026 16:15:00 -0700 Subject: [PATCH] fix(dashboard): don't offer read-only shared folders as drop targets Folders shared read-only lit up under a drag and took the drop, which the server then refused with "Forbidden". They no longer light up, and a drop on one sends the drag back where it began; they still open on a dwell. --- src/gui/src/UI/Dashboard/TabFiles.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/src/UI/Dashboard/TabFiles.js b/src/gui/src/UI/Dashboard/TabFiles.js index fd068e2f5..259cb3dbe 100644 --- a/src/gui/src/UI/Dashboard/TabFiles.js +++ b/src/gui/src/UI/Dashboard/TabFiles.js @@ -4005,6 +4005,13 @@ const TabFiles = { // — quietly rename the dragged file to "New Folder". if ( isPending() ) return; + // A folder shared read-only takes nothing; the server + // would refuse each item. The drag goes back instead. + if ( _this.isReadOnlyShare($(el_item).attr('data-path')) ) { + ui.helper.data('cancelled', true); + return; + } + const draggedPath = $(ui.draggable).attr('data-path'); if ( event.ctrlKey && draggedPath?.startsWith(`${window.trash_path}/`) ) { return; @@ -4032,9 +4039,12 @@ const TabFiles = { // not exist yet (see the drop handler above). if ( isPending() ) return; - $(el_item).addClass('selected'); - const _this = TabFiles; + // Not a drop target, but it still opens on a dwell. + if ( ! _this.isReadOnlyShare($(el_item).attr('data-path')) ) { + $(el_item).addClass('selected'); + } + const targetPath = $(el_item).attr('data-path'); // Don't auto-open the current directory or trash