Drop files as @-references; move internal DnD to pointer events#57
Merged
Conversation
Enable Tauri's OS drag-drop handler (dragDropEnabled: true) so dropping files onto the window inserts each as an `@<path>` reference into the active session's prompt, reusing the file explorer's PTY-write path. The OS handler swallows the webview's HTML5 drag events, so the four internal drag flows — tab reorder, tab→terminal split-drop, sidebar row → section, board card → column, and board column reorder — are rebuilt on pointer events via a shared `draggable()` primitive. It starts a drag only past a small threshold (so clicks/context-menus still work), captures the pointer, hit-tests targets in per-flow onMove/onDrop, and commits on release (Esc/cancel leaves state untouched). Tests: the iwft drag helpers now drive real pointer events (page.mouse) instead of synthetic DragEvents. Unit (49) + iwft (95) pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Dropping OS files onto the window now inserts each as an
@<path>reference into the active session's prompt — reusing the file explorer's PTY-write path.Getting file paths on drop requires Tauri's OS drag-drop handler (
dragDropEnabled: true), but that handler swallows the webview's HTML5 drag events. So the four internal drag flows are rebuilt on pointer events.Changes
tauri.conf.json—dragDropEnabled: true.main.ts—onDragDropEventhandler: writes@<path>per dropped file to the active session's PTY, then focuses the terminal.draggable(handle, begin)primitive: threshold-gated pointer drag with pointer capture, Esc/cancel handling, and click suppression. Commits on release over a target; Esc/pointercancel leaves state untouched (mirrors the olddrop-vs-dragendsplit).dragging*module vars and themakeSectionDropTarget/makeCardDropTargetwiring (targets are now annotated with data attributes and hit-tested from the source).page.mouse) instead of syntheticDragEvents; addedpointerDragElementto the base page object.Flows converted
Verification
npm run typecheckpassesNotes
@references (Claude Code ends the ref at whitespace). Matches the file explorer's existing unquoted behavior; can add quoting if wanted.🤖 Generated with Claude Code