🏠 back to Observable

FileAttachments UX suggestions

Just a few thoughts

  1. allow dropping a file anywhere in the page; currently if you drop a file, the browser does its default of leaving the observable page and showing the file. An engineering difficulty might be to avoid preempting a drop zone defined in the notebook.

  2. allow canceling an upload while it’s uploading (a cancel button on the “Uploading…” message)

  3. make the “copy code” less difficult to reach than the current item in an unnamed menu — for example it could be the default action on the file name, rather than an invisible download

  4. make the copied code less abstruse, so that it works immediately. An image should show as an image, etc. You could copy a slightly longer code that helps users with the default case, and advanced users would delete the traliing .image() if they want it as an array buffer etc. Even await could be given by default, since people in the know can delete it, but beginners can’t “invent” it.

  5. when uploading a file to the general page (step 1), it should create the relevant cell

  6. give files a default mime-type (from file name and or magic number) for various purposes

  7. auto-compress files, store as gz, or at least set the limit to 15MB compressed. Sometimes we have huge csv files that can be imported as a very small zip file, but having to deploy useless zip/unzip logic for these cases is a waste of time (and, on your side, a waste of space). An alternative might be to upload a .gz file and process it naturally, but I still haven’t found how to do this, or if it’s even possible)

  8. help set auto-compression on “files/” in the downloaded notebook (see What's your method to compress FileAttachements? )

3 Likes

What if dragging a file onto the page opened the file attachment sidebar? That would preserve the ability for users to drag and drop while still making it easy to attach a file.

1 Like

I like it too