Skip to content

feat(filemanager): add download all button and 4GB archive size warning/disable#333

Open
OnAirGame wants to merge 5 commits intocloudreve:masterfrom
OnAirGame:feat/download-all-button
Open

feat(filemanager): add download all button and 4GB archive size warning/disable#333
OnAirGame wants to merge 5 commits intocloudreve:masterfrom
OnAirGame:feat/download-all-button

Conversation

@OnAirGame
Copy link
Copy Markdown
Contributor

@OnAirGame OnAirGame commented Mar 31, 2026

Closes cloudreve/cloudreve#3397

Summary

Add a "Download all" option that fetches all files in the current folder (bypassing pagination) and triggers the existing download flow. Also disable the browser-side archiving option when total file size exceeds 4 GB.

Download button placement

Page Location Visibility
Share page (folder) "Download folder" button in toolbar (right of View/Sort) Always visible — easy access for share recipients
Share page (single file) Hidden — single file already has its own download
Main file manager "Download all" in more actions menu ("...") Available on all folders
Trash Hidden — downloading from trash doesn't apply

Details

Download all / Download folder

  • New downloadAllFiles thunk fetches all files with full pagination support (page_size: 1000, matching existing walk() pattern)
  • On the main file manager, accessible via the more actions menu
  • On share pages, a dedicated "Download folder" toolbar button provides immediate access for share recipients who just want to grab everything
  • No duplicate buttons — share pages show the toolbar button only, main file manager shows the menu item only

4 GB browser archive limit

  • Adds generic disabled support to DialogSelectOption and SelectOption dialog
  • When total selected size > 4 GB, the browser-side archiving (StreamSaver) option is disabled with a message showing the actual total size (e.g. "Total size 5.2 GB exceeds the 4 GB browser archive limit")
  • Other download methods (browser-side folder download, server-side archiving) remain available

Files changed

File Change
src/redux/thunks/download.ts downloadAllFiles thunk, 4 GB limit logic
src/component/FileManager/TopBar/NavHeader.tsx "Download folder" button on share pages
src/component/FileManager/TopBar/MoreActionMenu.tsx "Download all" in more actions menu
src/component/Dialogs/SelectOption.tsx disabled prop support
src/redux/globalStateSlice.ts disabled field on DialogSelectOption
public/locales/en-US/application.json i18n strings

Test plan

  • Main file manager: more actions menu → "Download all" → triggers download of all files
  • Share page (folder): "Download folder" button visible in toolbar → triggers download
  • Share page (single file): "Download folder" button NOT shown
  • Share page: no duplicate "Download all" in more actions menu
  • Trash view: "Download all" NOT shown in more actions menu
  • Select files > 4 GB → Download → browser-side archiving option disabled with size message
  • Select files < 4 GB → all archive options enabled normally
  • Folder with many files (>100): download all bypasses pagination correctly
DISABLE BUTTON DOWNLOAD ALL IN VIEWER DOWNLOAD FOLDER

…e for large files

Add a "Download all" option that fetches all files in the current folder
(bypassing pagination) and triggers the existing download flow. On share
pages, a visible "Download folder" button appears in the toolbar for
easy access by share recipients. On the main file manager, the option
is available in the more actions menu (hidden in trash view).

Also disable the browser-side archiving option in the archive method
picker when total selected file size exceeds 4 GB, showing the actual
size and explaining the limit.

- Add downloadAllFiles thunk with full pagination support
- Add "Download folder" button to share page toolbar (NavHeader)
- Add "Download all" to more actions menu (MoreActionMenu)
- Add disabled state support to SelectOption dialog
- Add i18n strings for new UI text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
<RadiusFrame>
<TopActions />
</RadiusFrame>
{showDownloadFolder && (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For folder(s) we already have those btn, so I think there is no need to add one more btn here.

Image

Copy link
Copy Markdown
Contributor Author

@OnAirGame OnAirGame Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This existing download works for selecting a folder from the parent, but if I'm inside a folder or shared folder there is no way to download all files. "Select all" only selects the current page due to pagination.

For a client, or a recipient of a link, I think it's important to have a one click 'download all' or 'download folder' button, especially in cases when there are lots of files being sent (for example a photo gallery from a job with 500 photos in it etc).

Similar services like frame.io and Dropbox have this feature for share pages specifically as a client or customer receiving a link they need an option to be able to download all the contents of the folder with one click.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats fine, but on mobile broswer (possibly, i just test on device simulation mode) is will looks like this

截屏2026-04-01 13 06 20

Maybe we should consider to re-locate that?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have made some tweaks to the UI/UX for this section, let me know if you like any of this flow

Mobile layout: The "Download folder" button now shows icon-only on mobile and text + icon on desktop, with a small animation.

No duplicate buttons: The download folder button automatically hides when files are selected, since the navbar's FileSelectedActions already provides a download button for selections (on mobile)

File summary in archive method dialog: The "Select archive method" dialog now shows a subtitle with the file/folder count and total size (e.g. "2 files · 4.5 GB"), giving users context about what they're downloading before they pick a method. This is a generic enhancement to SelectOption - added optional subtitle support that any dialog can use.

};
}

export function downloadAllFiles(index: number): AppThunk {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make a small change in backend to allow calculate total size on root file

{"code":403,"msg":"Not supported action","error":"cannot operate root file","correlation_id":""}

And then we can calculate the file size on server side and re-use the browserBatchDownload.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, cleaner approach. want me to wait for the backend change, or is the current frontend pagination approach OK for now?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I have raise a new pull request to backend, you may remove the pagination approach after it is merged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update to use this once merged

OnAirGame and others added 2 commits April 1, 2026 16:16
Co-authored-by: Darren Yu <YDL@YUDONGLING.NET>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
YUDONGLING added a commit to YUDONGLING/Cloudreve that referenced this pull request Apr 1, 2026
OnAirGame and others added 2 commits April 2, 2026 10:55
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d dialog

- Hide download folder button when files are selected (avoids duplicate
  with navbar download button)
- Show icon-only on mobile, text + icon on desktop
- Smooth horizontal collapse animation on button show/hide
- Add file/folder count and total size subtitle to archive method dialog
- Add generic subtitle support to SelectOption dialog
- Remove unnecessary fetchFiles wrapper
- Add i18n keys for file/folder counts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

[Feature Request] "Download All" button for share pages

2 participants