Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Use File System Access API if supported #254

Closed

Conversation

sauerman
Copy link

No description provided.

gfwilliams added a commit that referenced this pull request Jul 28, 2021
@gfwilliams
Copy link
Member

Thanks! Sorry for the delay looking at this. I was on holiday.

Ideally I'd have liked to keep the IDE working the same for 'normal' users (eg, no extra clicks needed), and I'm trying to avoid async and destructuring in the codebase at the moment. However I took your code as a base and re-wrote the IDE side of things in 3970caa

It should now be live at https://espruino.github.io/EspruinoWebIDE if you want to give it a try.

Basically, you open a file (which is as normal), then click the down-arrow to choose what happens. If you choose the 'upload' option then every time the file changes, the editor contents will be reloaded and the file sent to the device - which should be great for integration with VSCode/etc.

Thanks!

@gfwilliams gfwilliams closed this Jul 28, 2021
@gniezen
Copy link

gniezen commented Sep 3, 2021

If I understand correctly, this only handles the "Open file" side of things, but not the "Save file" part? I would imagine the File System Access API would be ideal to also save the file that's currently open?

Looking at 3970caa#diff-51d9f89cc909b0b11ec0534e24afded705617d1488ed4c49882aa8fab5352c16R215-R222 I should be seeing a "Save file.." dialog, but I'm not sure how to get this working?

@gfwilliams
Copy link
Member

I'm not sure how to get this working?

You just click the 'save' button?

But yes, right now it puts up a dialog each time you press the save button. Ideally it'd remember the file and just write to it again. What stopped me was figuring out how to do that nicely via the UI. I'm thinking maybe a drop-down under 'save' like we have for open and upload...

So first time (unless you opened a file before, you get the dialog). Otherwise you only get the dialog if you use the drop-down and 'Save As'.

@gfwilliams gfwilliams reopened this Sep 3, 2021
@gniezen
Copy link

gniezen commented Sep 3, 2021

right now it puts up a dialog each time you press the save button.

Hmm, that's not what happened for me. It just saved a new copy to my Downloads folder.

I'm thinking maybe a drop-down under 'save' like we have for open and upload...

Yes, I think that could work!

@gfwilliams
Copy link
Member

Sorry - closing this again. I thought it was an issue rather than PR :)

It just saved a new copy to my Downloads folder.

Argh, that's not good. What OS/browser are you on?

@gfwilliams gfwilliams closed this Sep 3, 2021
@drmercer
Copy link

It just saved a new copy to my Downloads folder.

Argh, that's not good. What OS/browser are you on?

This also happens to me, using Edge on Linux.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants