waveterm icon indicating copy to clipboard operation
waveterm copied to clipboard

Add drag-and-drop file support to terminal

Open stevenvo opened this issue 2 months ago • 1 comments

Summary

  • Adds drag-and-drop support for files in the terminal
  • Uses Electron's webUtils.getPathForFile() to get full file paths from dropped files
  • Automatically quotes paths containing spaces
  • Supports multiple file drops (space-separated)

Changes

  • emain/preload.ts: Import webUtils and expose getPathForFile API
  • frontend/app/view/term/term.tsx: Add drag event handlers to terminal view
  • frontend/types/custom.d.ts: Add type definition for new Electron API

Testing

Drag files from Finder onto the terminal - the full file path(s) should be inserted into the terminal input.

stevenvo avatar Jan 02 '26 21:01 stevenvo

[!WARNING]

Rate limit exceeded

@stevenvo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 12b35b4623706106e2a6cd15bfd5ef189f1faacd and 9eac3c9ff580a77920853475830a4421394d7a3e.

📒 Files selected for processing (4)
  • frontend/app/view/term/term.tsx
  • frontend/types/custom.d.ts
  • logs/.7472c96afe59df11c248c2c4b43edab0797adede-audit.json
  • logs/.e0987c2f02cc1cb106cf88cd0bfd7b7d8ea27fc9-audit.json

[!NOTE]

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This change introduces file drag-and-drop support for the terminal view by adding a new Electron API method. The implementation spans three layers: an Electron preload API method that resolves dropped files to filesystem paths, a TypeScript type definition for the new API, and terminal UI event handlers that collect dropped files, resolve their paths via the API, and send them to the terminal controller.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding drag-and-drop file support to the terminal view.
Description check ✅ Passed The description clearly explains the feature implementation, changes made, and testing approach; it is directly relevant to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Jan 02 '26 21:01 coderabbitai[bot]