feat(files): save selected files and folders to a device folder - #206
Draft
junkerderprovinz wants to merge 1 commit into
Draft
feat(files): save selected files and folders to a device folder#206junkerderprovinz wants to merge 1 commit into
junkerderprovinz wants to merge 1 commit into
Conversation
Adds a "Save to device" file action (single and multi-select) that lets the user pick a destination folder through the Storage Access Framework (ACTION_OPEN_DOCUMENT_TREE) and exports the selected files and folders there. Folders are recreated recursively and files that are not available locally are downloaded first, then copied into the target tree. Addresses opencloud-eu#180.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #180
What
Adds a Save to device file action (single file and multi-select) that lets the user pick a destination folder through the Storage Access Framework (
ACTION_OPEN_DOCUMENT_TREE) and exports the selected files and folders there. Folders are recreated recursively, and files that are not already available locally are downloaded first and then copied into the chosen tree.Today the app can only make files available offline (kept in the app's private storage); there is no way to save a file, or a whole folder, into a user chosen device folder such as Downloads. This addresses that (related: #69).
How
FileMenuOption.EXPORT, shown in the file list bottom sheet and the multi select action mode (removed from the details screen for now).ExportFilesToDeviceUseCaseenqueues anExportFilesToDeviceWorker(WorkManager) with the selected file ids and the picked tree URI (complex objects cannot be passed to a worker).GetFolderContentUseCase, recreating directories withDocumentFile; files copied into the tree. A file that is not local is downloaded into the app storage first (the same pathDownloadFileWorkeruses), then copied. It reports the result with a notification.Notes
Opening as a draft so CI can validate the build, and to gather feedback before polishing. Happy to adjust the UX (icon, label, where the action appears, the icon reuse, single vs. recursive behaviour) to your preference.