Skip to content

feat(files): save selected files and folders to a device folder - #206

Draft
junkerderprovinz wants to merge 1 commit into
opencloud-eu:mainfrom
junkerderprovinz:feat/save-to-device-folder
Draft

feat(files): save selected files and folders to a device folder#206
junkerderprovinz wants to merge 1 commit into
opencloud-eu:mainfrom
junkerderprovinz:feat/save-to-device-folder

Conversation

@junkerderprovinz

Copy link
Copy Markdown

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

  • New FileMenuOption.EXPORT, shown in the file list bottom sheet and the multi select action mode (removed from the details screen for now).
  • ExportFilesToDeviceUseCase enqueues an ExportFilesToDeviceWorker (WorkManager) with the selected file ids and the picked tree URI (complex objects cannot be passed to a worker).
  • The worker walks each selection: folders via GetFolderContentUseCase, recreating directories with DocumentFile; files copied into the tree. A file that is not local is downloaded into the app storage first (the same path DownloadFileWorker uses), then copied. It reports the result with a notification.
  • Reuses the SAF / content URI patterns already used for uploads and log export, and persists the tree permission.

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select where the file is download

1 participant