jgraph / drawio

draw.io is a JavaScript, client-side editor for general diagramming.
https://www.drawio.com
Other
41.36k stars 7.67k forks source link

Local file losing a file handler #4717

Open FarSeeing opened 3 weeks ago

FarSeeing commented 3 weeks ago

Preflight Checklist

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

If you are technical, you should reporting bugs along the lines of https://marker.io/blog/how-to-write-bug-report. If you are not technical, we will make allowances, please try to make an effort to understand the process.

Describe the bug When creating a new local (device-saved) diagram it gets opened in a new tab but then when you save that diagram - it gets downloaded on each save

To Reproduce Steps to reproduce the behavior:

  1. Go to a secure site (like https://app.diagrams.net/) using modern browser (to utilize window.showOpenFilePicker)
  2. Chose to store diagrams on a device
  3. Create a diagram selecting some file
  4. Modify & save it, verify it's saved silently,
  5. Create another diagram using the File → New... menu item
  6. Select another file
  7. The second diagram gets opened in a new tab
  8. Modify that new diagram and save it, verify it gets downloaded

Expected behavior I don't think it's possible to pass a file handler between windows (even same-origin ones) so I would think on changing LocalFile save behavior: if we don't have any file handler (exactly when we have a new tab opened) and the native window.showOpenFilePicker method is supported - call it.

Screenshots If applicable, add screenshots to help explain your problem.

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

Desktop (please complete the following information):

Smartphone (please complete the following information):

I tested the problem in incognito/private mode with all browser extensions switched off, write "yes" below:

Additional context Add any other context about the problem here.

FarSeeing commented 5 days ago

BTW, FileSystemFileHandle could be passed between tabs but works only for the same-origin tabs.