Skip to content

route native file drops to editor vs terminal based on drop surface#289

Merged
AmethystLiang merged 2 commits intomainfrom
fix-drag-file-to-coding-cli-issue
Apr 4, 2026
Merged

route native file drops to editor vs terminal based on drop surface#289
AmethystLiang merged 2 commits intomainfrom
fix-drag-file-to-coding-cli-issue

Conversation

@AmethystLiang
Copy link
Copy Markdown
Contributor

Summary

  • Add data-native-file-drop-target attribute to distinguish editor vs terminal drop zones at the preload level
  • Preload classifies native OS drops before forwarding via IPC so the renderer can route them correctly — terminal drops insert escaped paths into the active PTY, editor drops open files in tabs
  • Falls back to 'editor' for drops on untagged surfaces (sidebar, editor body) to preserve prior open-in-editor behavior

Test plan

  • Drag a file from OS onto the terminal pane → path is inserted into the active CLI
  • Drag a file from OS onto the tab bar → file opens in the editor
  • Drag a file from OS onto the editor body / sidebar → file opens in the editor (fallback)
  • Drag multiple files onto the terminal → paths are space-separated
  • Verify no regressions with in-app drag/drop (tab reordering, etc.)

- Default to 'editor' target when drop lands outside tagged zones,
  preserving the prior open-in-editor behavior for sidebar/editor body drops
- Add trailing space after each terminal-dropped path so multi-file drops
  are properly separated in terminal input
Add data-native-file-drop-target markers and IPC target field so the
preload can classify OS drops before forwarding to the renderer.
@AmethystLiang AmethystLiang merged commit 386fd03 into main Apr 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant