-
Notifications
You must be signed in to change notification settings - Fork 255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow drag and drop of image file in prompt textArea #566
base: master
Are you sure you want to change the base?
Conversation
@carlrobertoh no idea why the |
Noice! 👍 It happens because the tests on the Github runner are executed in headless mode. You can replicate this by running |
Ah I see, in the public DropTarget(Component c, int ops, DropTargetListener dtl, boolean act, FlavorMap fm) throws HeadlessException {
if (GraphicsEnvironment.isHeadless()) {
throw new HeadlessException();
}
...
} |
src/main/java/ee/carlrobert/codegpt/toolwindow/chat/ui/textarea/UserPromptTextArea.java
Outdated
Show resolved
Hide resolved
var t = evt.getTransferable(); | ||
var isSupportedFile = false; | ||
try { | ||
List<File> files = (List<File>) t.getTransferData( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, apparently this results in null
on macOS, or at least it doesn't work for me. 😞
Here's bit of a context: https://stackoverflow.com/a/64926775
I tried using the latest JB JRE while running the plugin locally, as suggested. I also installed the plugin manually on my actual IDE, but both scenarios resulted in a NPE. I haven't tried the first option yet tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm that is quite annoying. Unfortunately I do not have macOS so I can't try it out myself 🙃
7683b53
to
6479604
Compare
e57fa37
to
c417cca
Compare
ea9d9ee
to
b4dfde3
Compare
This PR closes #554
Adds support for drag&drop of a single image file into the prompt