Skip to content

Add batch upload popup#309

Open
kidneyhex wants to merge 3 commits intoespruino:masterfrom
kidneyhex:multi-file-upload-popup
Open

Add batch upload popup#309
kidneyhex wants to merge 3 commits intoespruino:masterfrom
kidneyhex:multi-file-upload-popup

Conversation

@kidneyhex
Copy link
Copy Markdown

Link: https://kidneyhex.github.io/EspruinoWebIDE/

An updated file upload. Just providing to save you time, if it helps. Take as much or none of it as you'd like. :)

  • Single files act the same as before.
  • Multiple files give a window listing them all with rename options.
  • Image/audio files get a "Convert" button that's required before upload. They show "pending" in red until the conversion has been set up, then "ready" in green.
  • Multiple files with the same "target name" give an error about the duplicate name.

(No special logic for metadata.json or apps, just the existing image/audio conversion.)

Multi-file popup

The status window is a little weird. The first file has a normal message and progress bar, then each file after that ends up getting its status messed up by the previous file's "Sent" status.

@gfwilliams
Copy link
Copy Markdown
Member

Ok, thanks! there are some massive changes here though - I'll have to wait until the new year before I can really look at them - and also test to make sure they still work ok on SD cards.

It would be good if you could try and look into the status issue - I don't feel great about merging something that we actually know has issues - especially as it could be trying to send over a new file while the last one is in progress.

I did take a quick look at the code though and it looks ok - maybe changing uploadNext(); to be setTimeout(uploadNext, 0); is enough if it's not a deeper issue?

One thing I did spot - it looks like maybe if you upload a wav/image/etc file it actually forces you to convert it before it'll upload? Previously you could upload a file without having to convert it - and there are cases (like developing for the Pip-boy) where you'd want to be able to upload a Wav file without conversion

@kidneyhex
Copy link
Copy Markdown
Author

Oops, I forgot I had this on my to-do list!

Initial testing with setTimeout(uploadNext, 0) is working. I'll try to test more if I get time this week.

For not converting: You can uncheck "Convert to Espruino" at the top of the popup. I'm open to other suggestions like defaulting to not convert, and only convert if clicking the button?

(I do need to fix the popups anyway, so clicking on labels are tied to their controls... I always forget that.)

@kidneyhex
Copy link
Copy Markdown
Author

Had unexpected free time (procrastination) and tested more.

The 0 second timeout is not working, but a 500ms timeout is enough to do the trick (on my machine anyway).

While testing that, I realized there was no way to cancel in the middle of uploading a ton of files.

So what about an overall progress window, and hide the individual file status popups? But then keep the 500ms delay so that the progress bar for individual files still shows correctly in the bottom right.

image

New Changes (that I can remember)

  • Tried to fix formatting issues when source filenames were long
  • Added to the conversion popups to make them more clickable
  • The overall progress popup & suppressing individual file popups
  • Default to not converting and just have the "Convert" button there if you want to convert

@kidneyhex kidneyhex force-pushed the multi-file-upload-popup branch from 5d4086c to 9555976 Compare January 26, 2026 01:40
@gfwilliams
Copy link
Copy Markdown
Member

Thanks! This is a pretty large set of changes now though - I'll have to look at this in a bit more detail when I get time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants