From 761a203d7c7630fc161fc6c64b32f3d22354cb8d Mon Sep 17 00:00:00 2001 From: Edouard Vanbelle Date: Sun, 26 Jul 2026 13:27:17 +0200 Subject: [PATCH] feat(drag&drop): dropzone is the while page --- .../src/lib/components/ResourceList.svelte | 17 +++- .../src/routes/files/[...path]/+page.svelte | 78 ++++++++++++++++++- 2 files changed, 93 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/ResourceList.svelte b/frontend/src/lib/components/ResourceList.svelte index 3da54ec4..956b7a43 100644 --- a/frontend/src/lib/components/ResourceList.svelte +++ b/frontend/src/lib/components/ResourceList.svelte @@ -297,6 +297,20 @@ * `enableSystemDrop` is false. */ onsystemdrop?: (e: DragEvent) => void; + /** + * Forces the OS-file drop overlay on regardless of whether the + * pointer is currently over `.rl-root`. Only takes effect when + * `enableSystemDrop` is true (otherwise there's no drop route + * behind the overlay). Meant for pages that track drag state + * at window level and want the overlay to react anywhere on + * the viewport — not just over the list — so drops on the + * page's title strip / margins get the same "drop to upload" + * cue. `/files/[...path]/+page.svelte` uses this. The overlay + * itself is already `position: fixed`, so activating it from a + * broader trigger costs no visual change — it OR's with the + * internal `systemDropOver` counter. + */ + systemDropOverlayActive?: boolean; /** * Render `` thumbnails on file rows and fall back to * client-side generation when the server doesn't have one @@ -394,6 +408,7 @@ breadcrumb, enableSystemDrop = false, onsystemdrop, + systemDropOverlayActive = false, enableThumbnails = true, isDraggable, isDropTarget, @@ -1419,7 +1434,7 @@ border alone read as decoration on busy folders. `pointer-events: none` on the container keeps it inert (drag events still hit `.rl-root` underneath so `dragleave`/`drop` fire correctly). --> - {#if systemDropOver && enableSystemDrop} + {#if enableSystemDrop && (systemDropOver || systemDropOverlayActive)}