From fc7ccc20ccf56441c2a2dfc2bf4629e0014e4433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Thu, 27 Aug 2026 06:51:46 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(app):=20dropping=20a=20file?= =?UTF-8?q?=20from=20outside=20the=20window=20imports=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stance-centre now answers gpui::ExternalPaths — drag_over tints the same DARK_RAISED fill every drop target in the darkroom already uses, on_drop hands every dropped path to Player::import, the one door argv/Import-button/Paste-path already share and that already forks .edith vs media (arrival) and refuses mid-export. --- crates/app/src/ui/stance.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/crates/app/src/ui/stance.rs b/crates/app/src/ui/stance.rs index 0a7eecc..0fd7646 100644 --- a/crates/app/src/ui/stance.rs +++ b/crates/app/src/ui/stance.rs @@ -1126,6 +1126,26 @@ pub(crate) fn render( .min_w(px(0.)) .flex() .flex_col() + // A file dropped from outside the window (gpui's + // `ExternalPaths`, Wayland's `text/uri-list`) lands here: the + // one room-wide surface under everything else drawn below, + // so a drop anywhere in the darkroom is heard. No prior + // press starts this -- the drop itself arrives as a + // `MouseUp` (`window.rs`) -- and the tint is the same + // raised fill every other drop target in the darkroom + // answers a drag with, DESIGN §8's affordance without a + // word of copy on it. + .drag_over::(|d, _, _, _| d.bg(rgb(DARK_RAISED()))) + .on_drop(cx.listener(|this, paths: &gpui::ExternalPaths, _, cx| { + // `Player::import` is the one door a project or media + // path already goes through (argv, the Import button, + // Paste path) -- it forks on `.edith` vs everything else + // itself (`arrival`) and already refuses during an + // export, so a drop names nothing this loop has to. + for path in paths.paths() { + this.import(path, cx); + } + })) .child(screen(player, position, window, cx)) .child(time_band(player, position, cx)) .child(divider(Split::Bench, cx))