From e6d9380d0e30326fb504dffb5df1162b7fad217e Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 16 Oct 2026 15:45:02 +0200 Subject: fix(island): say why a drop is refused A drop offering no local file:// URL was refused silently: the bubble vanished and nothing happened. Measured on the first report: the file manager offers a trashed file as trash:, with no path to read. The bubble now shows the reason for a moment, Trash named as such, and the refusal is logged with the URL schemes and offered formats (never the paths). Co-Authored-By: Claude Opus 5.5 --- desktop/island/Island.qml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'desktop/island/Island.qml') diff --git a/desktop/island/Island.qml b/desktop/island/Island.qml index 412cc58..5efe9bf 100644 --- a/desktop/island/Island.qml +++ b/desktop/island/Island.qml @@ -197,6 +197,9 @@ PanelWindow { // enters an input region, so the receptor is the sliver's width at rest // and grows to hold the bubble while a drag is over it. property bool dropHold: false + // Why the last drop was refused, shown in the bubble for a moment. + property string dropNote: "" + Timer { id: noteTimer; interval: 2500; onTriggered: win.dropNote = "" } Item { id: receptor @@ -218,25 +221,38 @@ PanelWindow { onDropped: drop => { win.dropHold = false; const paths = drop.urls.map(u => Files.fromUrl(u)).filter(p => p !== ""); - if (!paths.length) { drop.accepted = false; return; } + if (!paths.length) { + // Said, not silent: a source offering no local file:// + // URL looked like a drop that did nothing. The file + // manager offers a trashed file as trash:, which has no + // path to read. + const schemes = drop.urls.map(u => String(u).split(":")[0]); + console.warn(`island: drop refused, no local file in ${drop.urls.length} URL(s): ` + + schemes.join(", ") + ` formats: ${drop.formats.join(", ")}`); + win.dropNote = schemes.includes("trash") ? "That is in the Trash: restore it first" + : "Not a local file"; + noteTimer.restart(); + drop.accepted = false; + return; + } win.asst.attach(paths); drop.accept(Qt.CopyAction); } } Rectangle { - visible: win.dropHold + visible: win.dropHold || win.dropNote !== "" anchors { horizontalCenter: parent.horizontalCenter; top: parent.top; topMargin: 14 } width: parent.width height: 72 radius: 16 color: Qt.alpha(Theme.base, 0.9) border.width: 1 - border.color: Qt.alpha(Theme.accent, 0.6) + border.color: Qt.alpha(win.dropHold ? Theme.accent : Theme.red, 0.6) Text { anchors.centerIn: parent - text: "Drop for the assistant" - color: Theme.text + text: win.dropHold ? "Drop for the assistant" : win.dropNote + color: win.dropHold ? Theme.text : Theme.red font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 } } } -- cgit v1.2.3