CodeGPT icon indicating copy to clipboard operation
CodeGPT copied to clipboard

feat: allow drag and drop of image file in prompt textArea

Open PhilKes opened this issue 1 year ago • 3 comments

This PR closes #554

Adds support for drag&drop of a single image file into the prompt codegpt-drop-image2

PhilKes avatar May 16 '24 12:05 PhilKes

@carlrobertoh no idea why the ChatToolWindowTabPanelTest.testSendingOpenAIMessageWithImage fails, it succeeds locally. No X11 DISPLAY variable was set, but this program performed an operation which requires it. https://github.com/carlrobertoh/CodeGPT/actions/runs/9112340838/job/25051402045?pr=566#step:4:724

PhilKes avatar May 16 '24 12:05 PhilKes

Noice! 👍

It happens because the tests on the Github runner are executed in headless mode. You can replicate this by running export JAVA_TOOL_OPTIONS='-Djava.awt.headless=true' before executing the tests. Not sure what the fix is yet.

carlrobertoh avatar May 16 '24 19:05 carlrobertoh

Noice! 👍

It happens because the tests on the Github runner are executed in headless mode. You can replicate this by running export JAVA_TOOL_OPTIONS='-Djava.awt.headless=true' before executing the tests. Not sure what the fix is yet.

Ah I see, in the DropTarget constructor:

public DropTarget(Component c, int ops, DropTargetListener dtl,   boolean act, FlavorMap fm)  throws HeadlessException   {
        if (GraphicsEnvironment.isHeadless()) {
            throw new HeadlessException();
        }
      ...
}

PhilKes avatar May 17 '24 13:05 PhilKes