Under "how to save a file" [1] it tries to use window.showSaveFilePicker (which has poor browser support) and falls back on creating an invisible link and clicking on it.
It seems a bit much, versus just having a download link, possibly styling it as a button. What do you get for that?
The advantage of using the `showSaveFilePicker()` method is that you can get a `FileSystemFileHandle`, with which you can then implement a true "edit, save, edit, save,…" flow; always saving over the current file, instead of downloading copies on each "save".
As a user, I think that's a very unexpected feature. When a file crosses the border from browser to file system, I expect it to remain untouched. This approach feels very unnatural to me.
As a user, I think that it is a very expected feature. When use a browser as an editor, I expect it to change the file when I save it. This approach feels very natural to me.
thats the problem. You should never be doing that. You should be using an editor, as an editor. The confusion is understandable though, as in general editors [1] aren't [2] widely [3] available [4] for [5] people to use.
2. https://github.com/emacs-mirror/emacs
3. https://github.com/xi-editor/xi-editor