[whatwg] Drag-and-drop folders/files support with directory structure using DirectoryEntry
glenn at zewt.org
Thu Nov 17 12:28:44 PST 2011
On Thu, Nov 17, 2011 at 1:18 PM, Jonas Sicking <jonas at sicking.cc> wrote:
> I'm still not convinced that providing an API which provides
> asynchronous traversal of the files is going to lead to a better user
> experience. In all scenarios that I can think of, the page which
> received the drop is going to want to traverse the whole directory
> tree anyway.
I gave lots of examples. Those and a few more: accessing Subversion and
Git repositories (you may only care about a few specific files within
.svn/.git, and not at all about the working copy surrounding them); general
file browsers; skipping subdirectories you know you're not interested in
(eg. .svn in a source code analysis tool); queueing tasks (begin uploading
asynchronously when the user drags in a directory; the user can drag in
more directories immediately without waiting).
So much effort has been made to move towards fully asynchronous UI that
making this synchronous would be a major loss, and this also leads very
nicely towards a read-write interface.
I think there's an even bigger problem with doing traversal in advance.
You can't wait until the drag completes (eg. the mouse is released) before
performing the traversal; it needs to be complete before the first
dragstart event can be fired, to fill in DataTransfer. Even if the
traversal is lazy, any code which triggers the traversal will force the
user to sit there holding down the mouse button, waiting for it to complete.
More information about the whatwg