Repository navigation
Closed
Description
Decided (user, 2026-11-10): spike drag and drop before M5, so that scroll (M5) and overlays (M6) are shaped by what drag needs. The production DnD API is decided after the spike. Implementation of #33 and #23 is still unscheduled.
Scenarios the spike must run
- Reorder in
todo(Drag to reorder (live reorder, ghost, Esc to cancel) #23): drag a row by its body. The list reorders live as the pointer crosses rows, and siblings slide with Animate position changes of keyed nodes (FLIP) #30animate_layout. A drag image follows the pointer. Esc restores the original order. Releasing outside the list cancels. - List to zone (Drag and drop: drag sources, drop targets, OS file drops routed to nodes #33, in-app): drag an item from one list onto a drop zone. The zone shows hover feedback while a compatible payload is over it, and receives the drop with its position inside the zone. An incompatible payload type shows no feedback.
- OS file drop (Drag and drop: drag sources, drop targets, OS file drops routed to nodes #33): drag files from the desktop onto one of two zones. The hovered zone shows a hint, and each zone accepts or refuses by file type. Native only; check whether the web build gets drops.
Questions the spike must answer (in a design note, docs/dnd.md)
- Can egui's DnD payload API (
Response::dnd_set_drag_payload,dnd_hover_payload,dnd_release_payload,egui::DragAndDrop) carry all three scenarios, or what's missing? - Build-time state: how does the view read "what is being dragged and over what" during build, to render gaps, placeholders and highlights? One frame of lag is acceptable or not; say which and why.
- Identity across rebuilds: does egui keep the drag when the source node is rebuilt elsewhere (live reorder)? What does bullseye have to guarantee: stable ids, a sense on the node, never inert?
- Hit-testing targets: layout rect versus painted rect under FLIP; nested targets; which one wins (encode once, per CLAUDE.md).
- The drag image: paint the source's shapes under the pointer (the ghost mechanism of Exit transitions: animate a keyed node out before it leaves the tree #35), or a separate chip? What's the cheapest that works?
- Scroll (M5): auto-scroll near the edges of a scroll container during a drag, and wheel during a drag. What M5 must expose.
- Overlays (M6): drag over and onto popovers and sheets; the z-order of the drag image.
- Keyboard: a non-pointer way to reorder (e.g. move with modifier+arrows), and whether accesskit has a DnD story.
- Cancel: Esc, release outside, and the window losing focus.
- The core changes needed, if any (an active-gesture model, a new paint variant
drag_over, NodeHandle methods). List them with the reason for each.
Output
- A branch with spike code (not merged as-is) and the design note, opened as a draft PR for review.
- The note ends with a proposed API sketch and a list of the issues to file (production DnD, M5 and M6 requirements).
Metadata
Metadata
Assignees
Labels
No labels
Activity
samitbasu commentedon Nov 10, 2026
Scope addition (user, 2026-11-10): a gallery scenario, as an example plus tests.
animate_layout.Tests through the real harness path:
RawInput::hovered_files/dropped_filesif the harness allows it, otherwise said plainly.samitbasu commentedon Nov 10, 2026
Real use case (user, 2026-11-10): the gallery stands for telemetry windows in 1, 2 or 3 columns, inside a scroll area. That makes scenario 4:
animate_layouttoo. That is the same relative-to-parent rule.ScrollAreahosting the bullseye subtree if that's cleaner. It records what M5 must provide. It is not M5.Gallery: no flash on drop; a visible column and drag-image picker (#71)
Gallery panels show a live telemetry trace (#71)
Live drag image: a paint-layer override lifts the real node (#71)
Gallery: lay out at the viewport height, so a column change slides (#71)
The lifted panel is anchored to the screen, not offset from last fram…
samitbasu commentedon Nov 10, 2026
The spike's four one-frame glitches led to #76 (frame-continuity checker, sweeps and fuzzing, design rules).
samitbasu commentedon Nov 10, 2026
Native check (user, 2026-11-10), Fedora on Wayland: dragging a
.pngfrom the file manager ontodnd_galleryproduced no reaction at all: no hover gap and no drop.Cause, verified in source: winit 0.30.13 (bullseye's version through eframe) delivers
HoveredFile/DroppedFileonly from its X11 backend (platform_impl/linux/x11/event_processor.rs). The Wayland backend has no file drag-and-drop, so nothing reaches egui. Not a bullseye bug.Pending: a re-run under XWayland (
env -u WAYLAND_DISPLAY cargo run --release --example dnd_gallery) to see whether X11 delivers the drop, and whether a live position follows the cursor during an outside drag.Options for the requirement "drops into the app":
rfdvia the desktop portal), which works everywhere.The production DnD design must state per-platform behaviour.
samitbasu commentedon Nov 10, 2026
Correction and upstream status: winit 0.31 (beta) reworks file DnD into
DragEntered/DragMoved/DragDropped/DragLeft, with the pointer position (v0.31.0-beta.1 release notes). winit #4571 (merged 2026-07-16) implements receiving and initiating drags on Windows, Wayland and macOS. bullseye is on 0.30.13 through eframe, so it doesn't have this. Per third-party reports (unverified): eframe's winit 0.31 migration is a draft (emilk/egui#7731), and a 0.30.x Wayland backport (#4729) is open.Consequence for the design: design outside drops against 0.31's event model, which supplies a live position on all platforms. Adopt it when eframe moves (CLAUDE.md: migrate first, don't build on the deprecated surface). In-app DnD doesn't depend on winit and can proceed now.
samitbasu commentedon Nov 10, 2026
macOS check (user, 2026-11-10): dragging a
.pngfrom Finder ontodnd_galleryshows the drag cursor. On drop, a new panel is appended at the end of the list. winit 0.30 delivers the drop on macOS but no pointer position during the hover or at the drop, so the shared insertion resolver gets no point and falls back to the end. There is no hover gap.Summary on winit 0.30: macOS delivers the drop without a position; Linux/Wayland delivers nothing; X11 delivers the drop without a position (per source); the web delivers no position. Positioned outside drops therefore need winit 0.31's
DragMoved/DragDropped(#78) on every platform.Spike follow-up: the demo failed silently: the panel appended off-screen, and
app.droppedis never shown. A status line and scroll-into-view are proposed.samitbasu commentedon Nov 10, 2026
Correction to the macOS result (user retried, 2026-11-10): the drop does insert the new panel where the cursor is released. What's missing is the live preview while hovering: no gap follows the cursor, the panel just appears on release. The first tries appended at the end, most likely drops where no fresh pointer position had arrived yet.
Corrected summary on winit 0.30:
#78 (winit 0.31
DragMoved) is what adds the live preview everywhere, and Wayland support.docs/dnd.md: two-level target feedback, verified platform results (#71)
docs/dnd.md: the drag image is live, not a snapshot ghost (#71)
Gallery: call the drag image Live, not Ghost (#71)
samitbasu commentedon Nov 11, 2026
Spike complete. Its findings are in docs/dnd.md on main; production landed in #87.