You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces kind of a funny UX where you need to be in "file" mode to drag and drop files and "directory" mode to drag and drop directories - it would probably be better to let users drag and drop whatever they want, and only really differentiate between types of uploads in the "click to browse files" flow.
In order to do this we will probably need to move away from the HTML Input-based drag and drop functionality and use the HTML Drag and Drop APIs directly:
Just want to note that there's an annoying UX quirk that will also be fixed by this - if you try to drop a directory into the "File" upload input the upload UI will hang and never error out. This is partly due to a quirk in the upload-client encoding logic where an error in one of the encoding functions is not caught - after looking at the code I'm not quite sure how to fix:
Complicating the fix at the UI level is the fact that in this particular situation the browser passes along a File object representing the directory itself rather than the files in the directory, with no way to tell that the File is actually a directory. If we could tell it was a directory we could just avoid the error-causing situation entirely, but I don't see a clear path to that with the HTMLInput-based drag and drop API.
I could definitely invest more hours into trying to fix this as it is, but it feels like that time would be better spent moving to the newer HTML drag-and-drop API!
travis
added a commit
to storacha/w3up
that referenced
this issue
Jan 17, 2024
right now errors in the `finalize` methods can leave a writer unclosed forever - this should help improve the DX issues described in storacha/console#81 (comment) by at least printing an error to the console with information about the problem
We added the ability to upload directories in #79
This introduces kind of a funny UX where you need to be in "file" mode to drag and drop files and "directory" mode to drag and drop directories - it would probably be better to let users drag and drop whatever they want, and only really differentiate between types of uploads in the "click to browse files" flow.
In order to do this we will probably need to move away from the HTML Input-based drag and drop functionality and use the HTML Drag and Drop APIs directly:
https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop
The text was updated successfully, but these errors were encountered: