S014: in-app drag and drop with drop targets, drop menu and bookmark drops

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
astar76 2026-11-18 20:02:51 -06:00
commit f503a7c987

View file

@ -151,5 +151,14 @@ One entry per session, newest last, ≤ 15 lines: done, verified how, not done,
- Verified: workspace build, clippy -D warnings, fmt --check; screenshot of a scratch folder: 2 hours ago, 5 minutes ago, Just now, Friday, Nov 9, Nov 18 2025, Yesterday, all 12-hour.
- Not done: 24-hour and Absolute not screenshotted; timer not stopped when nothing is fresh; "visible row" check covers all rows of a pane; conflict dialog dates use the same setting but were not looked at.
## S014 — In-app drag and drop
- Done: `dnd.rs` `DragDrop` on the Slint `Dnd` global (`components/drop-menu.slint`: `DropTarget {row, pane, tab, crumb, place, bookmarks}`, `DropAction {ask, move, copy, link}`, `DropZone` = DropArea + animated primary glow, `DropMenu`). Sources: rows/cells (DragArea, selection if the row is in it, else the row), bookmarks (user data, reorder only). Targets: folder rows/cells, pane background, tabs (open after `Motion.drag-switch-delay`), crumbs, places, bookmarks header/empty text (adds local folders).
- **Payload**: `text/uri-list` (`dnd::uri_list` / `parse_uri_list`, CRLF) as plain text, plus `set_file_paths` when all local. **Entry point**: `DragDrop::drop_uris(sources, dir, DropAction)` (native DnD S030/S031 calls it; refuses self/descendant/same folder/read-only). `DropAction::Ask` stores the drop and opens the menu (`open-drop-menu`, `drop-chosen`).
- Modifiers: Slint's drop event proposes move for both Shift and no key, so `Dnd.shift` is tracked by the window's `capture-key-pressed/released`; Ctrl/Ctrl+Shift come from the proposed action.
- Drag image: SVG pill (name, count badge) in theme colours via `Image::load_from_svg_data`. Sidebar Flickable has `mouse-drag-pan-enabled: false`.
- Verified: workspace build, clippy -D warnings, fmt --check, literal grep empty; `TUNAL_DRAG` smoke (new, in screenshot.rs): drag held over a folder row (glow + drag image), drop → menu over the row; folders dropped on Bookmarks added; bookmark dragged onto another reordered (places.toml).
- Not done: no live window (real pointer, Shift/Ctrl keys, tab hover switch, menu choice running a job); count badge not looked at (single-item image only).
- Later: autoscroll at list edges while dragging; select the row a drag starts from; spring-open folders on hover; breadcrumb crumbs overlap in a long path (seen in S014 smoke, already in HEAD before S014).
## Later
-