-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Drag and drop folder #1
Comments
The demo at https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#result seems to show that the browser doesn't let Javascript code retrieve the full path to the files. Instead, what is exposed as |
Hmm, but can you not reverse walk the tree and then recreate the path? |
@thadguidry Interesting, few initial thoughts, this will require the user to select the file system root to get the full path. We will be dependent on the user having selected the root FS. Browser will prompt the user for access permission for all the root level folders. This could be a challenge to users? |
@thadguidry @wetneb @magdmartin I played around with the it and here is an option. I am only listing directories with full path information. user can copy paste path from this view. |
The screenshot above shows the full path from the directory you selected to the file, but that's not enough. We'd need the absolute path, which is something different. Even if you asked the user to select the root directory of their file system (which would be pretty terrifying), it wouldn't be enough (on Windows you'd be missing the drive letter for instance). |
@wetneb Yes you are absolutely correct. The directory path listing can be a temporary workaround for PAWS maybe? |
Browsers of course are limited for local file access. So, we know Node and Java, if given the right access, have full access to the file system.
Or if not JavaFX, then using Node (which can run locally and has file access also)? Hmm, Node would need to be packaged then in OpenRefine, but that's an option also. |
But it seems best, that since we already have OpenRefine Server running, and the Browser JS can make calls to Server, then we'd just use OpenRefine server to do the job and return File objects. |
@wetneb @thadguidry @magdmartin files-newFlow.mov |
Looks Great! But I can't really comment, since I don't use the Wikimedia Commons Upload functionality and don't know what needs to happen next after this step, or what others might want to do further with file listing data. I'd ask @Ainali |
@thadguidry Thank you. This is a new extension called FilesExtension which creates a project with details of files in folder(s) |
That's a nice way to do it, but as I understand it it will require the user to select a folder at the root of their filesystem hierarchy via the native file picker, right? And then select the folder they actually want to import via our web UI. Isn't that confusing? It can be that it's easier to use than pasting an absolute file path (because you don't need to know what an absolute file path is anymore), but I am not sure. |
As the use case requires folder(s) selection, the most ideal case is the file picker allows folder select & provides path info. In absence of this the alternative options is a 2 step process, we can try to replace the 1st step by providing canned options of root folders based on the OS and user selects that instead of having to drag-drop the root folder. The 2nd step is exactly what the user would do with a file picker. |
@sunilnatraj in that case could we skip the drag and drop and display the folder tree directly for the user to navigate? |
@magdmartin This option will not require the user to drag-drop, however the directory list creation will also move to java (backend). This will require the OpenRefine application to have permissions to access the file system. In the case of drag-drop the access grant prompt comes up in the browser and user has control over access grant. Which option will be better to pursue
|
@wetneb @magdmartin @Ainali Demo of updated flow, I have provided user with option to get directory details by selecting a root drive/folder OR do a drag-drop. In this recording user selects a root drive / folder, the directory details is generated by the java backend. The end user flow is the same as drag-drop flow. Also attached is the security permission grant alert that user will get. filesExt-flow2.mov |
That looks pretty good to me! |
@wetneb @Ainali @magdmartin @antoine2711 I have updated the flow and below is a demo of the updated flow ( shortened to fit the 10MB size limit).
fileExt-V2.mov |
Even better! I am happy with that workflow. |
@Ainali @magdmartin @antoine2711 PFA File extension install; It will be great if you can try it out & share your feedback. |
@sunilnatraj I tested it with OpenRefine 3.8.7 on ubuntu 22.04 and chrome. It worked well. The flow works fine, it had to wait few seconds for the tree of my My only suggestion would be to name the project by default with the folder path instead of the standard We may want to add more information on the start page to indicate what the FileExtension purpose is. My concern with the |
when designing the feature in OpenRefine/OpenRefine#5048 the conversation between @Ainali and @sunilnatraj branched on the support for drag and drop folder.
Here is @thadguidry suggestion for implementation:
Originally posted by @thadguidry in OpenRefine/OpenRefine#5048 (comment)
The text was updated successfully, but these errors were encountered: