drawio icon indicating copy to clipboard operation
drawio copied to clipboard

When opening a local file using drag and drop, it cannot update/save changes

Open mawid6 opened this issue 2 years ago • 5 comments

Preflight Checklist

  • [x] I agree to follow the Code of Conduct that this project adheres to.
  • [x] I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Describe the bug When opening a local file from device using the menus, things work as expected, doing a save (ctrl-s) will update the opened file. When opening the same file by dragging it into the drawio editor, the behavior is different: Saving does not work, and doing a save (ctrl-s) will not do a save and update the opened file - instead it opens the general save modal dialogue (update: or - as of today Aug 15th 2022 - it downloads a new copy of the file).

To Reproduce Steps to reproduce the behavior:

  1. Start drawio/diagrams.net web app
  2. Locate a diagram on your local drive. Drag that file onto the drawio canvas to open it.
  3. File opens. Optional: Make a small change.
  4. Press ctrl-s to save your changes to the diagram file.

Expected behavior A save is completed - the local file is updated (a dialogue to allow the browser app access to the file system is displayed, you click ok and after that the changes are committed to disk).

Actual behavior The general save modal dialogue is displayed, offering the choice of storage. Update: or - as of today Aug 15th 2022 - it downloads a new copy of the file.

draw.io version (In the Help->About menu of the draw.io editor):

  • draw.io version 18.0.7

Desktop (please complete the following information):

  • OS: windows 10
  • Browser chrome
  • Version 101.0.4951.67 (Official Build) (64-bit)

Additional information In the same theme of issues related to opening/saving diagrams as #2825 ( https://github.com/jgraph/drawio/issues/2825 ).

mawid6 avatar Jun 07 '22 13:06 mawid6

Dragging a file to the editor is importing the file in the current one. It is not equivalent to opening.

m-mohamedin avatar Jul 14 '22 08:07 m-mohamedin

Dragging a file to the editor is importing the file in the current one. It is not equivalent to opening.

TLDR: No, that is not accurate. That is one of the drag operations, dragging to the canvas. I not talking about dragging to the canvas to import. I am speaking of dragging to the app, to open. Can I please ask you to check and reopen this ticket?


Longer: Oh, ok, so you are saying it is by design - that there is no support for opening a file via drag and drop.

Wrong. I am pretty sure your statement is incorrect. Why:

(A) Docs. Reading the documentation on diagrams.net in the official FAQ, where @davidjgraph writes:

Drag and drop: Alternatively, there is a faster way to open a diagram stored on your local device - simply drag the diagram file onto the diagrams.net drawing canvas.

tells me different.

(B) Both import & open are supported, as different operations: The behavior of the webapp UI fairly closely follows the desktop app, and they both provide different feedback to distinguish between two different drag and drop targets, providing different cues to each.

If you drag to the:

  • canvas: the contents of the dragged diagram are indeed imported into the canvas. The cue is that the canvas is outlined with a dashed box. It is a smaller/inner outline.
  • window: the diagram is opened. This applies to both in both webapp and desktop app. Again, the cue is - this time - that the entire window (and not just the canvas) is outlined with a dashed box. It is a larger/outer outline.

Again, in this issue, I am talking about opening via drag, which you can do by dragging to the window - not the canvas.

Now, this ticket actually talks about a problem that happens after the diagram has opened: In the desktop app, everything works as you would expect, and the open operation has achieved the same result as if you open via the menu. However, in the webapp, as described in this ticket, each time I press ctrl-s to save, the original file is not updated as would be expected.

So I would be grateful if you would reopen this issue, since I spent some time describing it.

mawid6 avatar Aug 15 '22 13:08 mawid6

( Also note: I have updated that with my brief testing today, the save dialogue is not opened, but rather, a copy of the updated diagram is immediately downloaded. It may be that both behaviors appear, depending on something - I am not sure. It does not matter much - it does not alleviate or worsen the issue described. )

mawid6 avatar Aug 15 '22 13:08 mawid6

I did not write the article, it just shows who created the page.

The article is wrong, I've deleted it.

davidjgraph avatar Aug 15 '22 14:08 davidjgraph

OK @davidjgraph, I did not know that, seems like a fair assumption given that it had your name on it - but I understand now, thanks for clarifying.

Thanks for reopening this! I think it would be truly great to have this working.

mawid6 avatar Aug 19 '22 08:08 mawid6

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. See the FAQ for more information.

stale[bot] avatar Mar 25 '23 12:03 stale[bot]