From 29a9c0f35d0d64e2fd4a8cc620b3b178ed01eb36 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Wed, 9 Sep 2026 17:34:22 +0200 Subject: [PATCH] Limit a page to one drop zone per layer --- .../BatchProcessing/AssistantBatchProcessing.razor | 8 +++----- .../Components/PathDropZone.razor.cs | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/app/MindWork AI Studio/Assistants/BatchProcessing/AssistantBatchProcessing.razor b/app/MindWork AI Studio/Assistants/BatchProcessing/AssistantBatchProcessing.razor index c0099c70..7e9429d9 100644 --- a/app/MindWork AI Studio/Assistants/BatchProcessing/AssistantBatchProcessing.razor +++ b/app/MindWork AI Studio/Assistants/BatchProcessing/AssistantBatchProcessing.razor @@ -7,9 +7,7 @@ @T("Input") -@* This page carries a second drop zone for the instructions, so neither of them catches all - documents: with two targets, only the one under the mouse may take the drop. *@ - + @@ -46,7 +44,7 @@ @if (this.promptSource is BatchProcessingPromptSource.FREE_PROMPT) { - + @@ -54,7 +52,7 @@ } else if (this.promptSource is BatchProcessingPromptSource.FILE_IMPORT) { - + @if (!string.IsNullOrWhiteSpace(this.promptFilePath)) { diff --git a/app/MindWork AI Studio/Components/PathDropZone.razor.cs b/app/MindWork AI Studio/Components/PathDropZone.razor.cs index 0be8256d..09d6b0b9 100644 --- a/app/MindWork AI Studio/Components/PathDropZone.razor.cs +++ b/app/MindWork AI Studio/Components/PathDropZone.razor.cs @@ -36,6 +36,15 @@ public partial class PathDropZone : MSGComponentBase /// /// Catch all documents that are hovered over the AI Studio window and not only over the drop zone. /// + /// + /// Practically every zone needs this today. Hovering is detected through mouse events, and no + /// webview delivers those while a native drag is in progress, so a zone without this flag + /// hardly ever catches anything. The consequence is that two zones of the same layer cannot be + /// told apart: the one carrying this flag takes every drop, including the ones meant for the + /// other. A page may therefore hold only one zone per layer. Lifting that limit needs the + /// cursor position, which the runtime receives from Tauri and currently discards in + /// app_window.rs. + /// [Parameter] public bool CatchAllDocuments { get; set; } @@ -149,8 +158,9 @@ public partial class PathDropZone : MSGComponentBase if(this.Disabled || this.numDropAreasAboveThis > 0) return; - // The webview gets no DOM drag events while a native drag is in progress, so the mouse is - // what tells us whether the user is aiming at this zone: + // A native drag delivers no DOM events at all, mouse events included. This fires before a + // drag begins, while the pointer still moves freely, which makes it a hint about where the + // user is aiming rather than a reliable signal. See the remarks on CatchAllDocuments: this.isComponentHovered = true; this.SetDragClass(); this.StateHasChanged();