Add file_drop: drop files onto a window via WM_DROPFILES#404
Merged
Conversation
clipboard_files stages a file list on the clipboard for Ctrl+V; this actively drops files onto a target window (the completion of a drag-and-drop) by posting WM_DROPFILES. Reuses clipboard_files. build_dropfiles to pack the DROPFILES blob (shared byte layout) and dispatches through an injectable driver seam, so build-and-dispatch is unit-testable with a fake driver; the real GlobalAlloc + PostMessage lives in the default Win32 driver. plan_file_drop is a pure dry-run.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 19 |
| Duplication | 1 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
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.



Why
clipboard_filesstages a file-drop list on the clipboard so a user canCtrl+Vit;file_dropactively drops files onto a target window — the completion of a drag-and-drop — by posting aWM_DROPFILESmessage carrying aDROPFILESblob.drop_files(hwnd, paths, point=, driver=)— pack the blob and postWM_DROPFILESto a windowplan_file_drop(paths, point=)— pure dry-run returning{message, paths, point, wide, blob_size}Design
clipboard_files.build_dropfilesto pack theDROPFILESblob (shared byte layout, not re-implemented).(hwnd, blob, point) -> bool, so the build-and-dispatch logic is unit-testable on any platform with a fake driver; the realGlobalAlloc+PostMessageW(WM_DROPFILES)lives in the default Win32 driver (the receiving window owns/frees the memory viaDragFinish).__all__→AC_drop_files(device) +AC_plan_file_drop(pure) →ac_*MCP tools (drop side-effect-only, plan read-only) → Script Builder (Window). Qt-free verified.Tests
test/unit_test/headless/test_file_drop_batch.py—plan_file_droppayload + packing reuse,drop_filesdispatching a real parseableDROPFILESblob to an injected driver (round-tripped throughparse_dropfiles), driver-result passthrough, empty-paths errors, the pure executor path, and 5-layer wiring. 14 passed with theclipboard_filessibling. Real Win32PostMessagenot executed in CI.