Camunda-modeler: Drag & Drop of file from Visual Studio Code does not work

Created on 3 Jun 2021  路  5Comments  路  Source: camunda/camunda-modeler

__Describe the Bug__

No drop zone appears when dragging a file out of the vscode into the Camunda Modeler window.

__Steps to Reproduce__

  1. Drag a BPMN file from vscode explorer to Camunda Modeler

It looks like vscode is just providing the absolute path to a file. I can drop it into a text field of the properties panel and see the correct path to the file. Could we somehow work with that and open the file?

__Expected Behavior__

The BPMN opens.

__Environment__

  • OS: Ubuntu 20.04.2 LTS
  • Camunda Modeler Version: 4.9-nightly.2021-05-20
  • Execution Platform: Camunda Cloud
  • Installed plug-ins: Cloud Sync, Layering, Linter, Generate Technical IDs, TX Boundaries, Property Info
backlog bug

All 5 comments

Could you verify if dropping from VSCode works into any other editor (i.e. a text editor)? I'd love to understand if that is common, expected behavior.

I have the same behavior with a text editor: drag & drop pastes the file name as a string into the text but does not open the file.

I'm wondering if it is a Linux-specific behavior or something configurable or if it is by design. I saw a YouTube video in which drag & drop on Mac OSX created a file on the desktop. For me it creates a desktop note.

In either way, this issue makes it really hard to open a BPMN file directly out of VSCode. The only way I found so far is opening the containing folder in the system explorer and then locating the file in there. However, that requires an external tool and one might pick the wrong file in folders with many models.

I've tested this on MacOS 10.15.7. Below are the results of dragging and dropping an example.bpmn file:

| Drop target | Result |
| - | - |
| Desktop | File was copied to the Desktop |
| TextEdit | File path was pasted |
| JetBrains WebStorm | Nothing |
| GIMP | Nothing |
| Camunda Modeler | Nothing |

I've also tried to drop a JavaScript file on WebStorm but with no result. Same with dropping a PNG file on GIMP.

(all dragging was done from VSCode)

I've also checked what kind of data is attached to drag events created in VSCode.

VSCode attaches 3 items to the event. Below are the contents as in my test:

| item.kind | item.type | item.getAsString() result |
| - | - | - |
| 'string' | 'text/plain' | '/Users/maciej/Downloads/example.bpmn' |
| 'string' | 'codeeditors' | '[{"resource":"file:///Users/maciej/Downloads/example.bpmn","options":{"viewState":{"cursorState":[{"inSelectionMode":false,"selectionStart":{"lineNumber":10,"column":3},"position":{"lineNumber":10,"column":3}}],"viewState":{"scrollLeft":0,"firstPosition":{"lineNumber":1,"column":1},"firstPositionDeltaTop":0},"contributionsState":{"editor.contrib.wordHighlighter":false,"editor.contrib.folding":{"lineCount":611,"provider":"indent"}}},"sticky":false},"encoding":"utf8","mode":"xml"}]' |
| 'string' | 'resourceurls' | '["file:///Users/maciej/Downloads/example.bpmn"]' |

Note that item.getAsString call shows the result only on drop. As an effect, in the potential implementation we could not tell whether we can open the dragged files until the drop event occurs. This is contrary to already existing mechanism where we don't react to dragging of unknown files (e.g. PDF, PNG etc.).

Thanks for investigating folks!

Moving this one to the backlog as this does not seem to be _common behavior_ an is not easily fixable on our side, too.

I think, looking into the future we could consider to react to drop events only and support file path ending with known extensions, too (https://github.com/camunda/camunda-modeler/issues/2299#issuecomment-857492491).

Was this page helpful?
0 / 5 - 0 ratings