Skip to content
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

[Files] Download multiple files in a zip #1459

Merged
merged 49 commits into from
Aug 24, 2021
Merged

Conversation

Tbaut
Copy link
Collaborator

@Tbaut Tbaut commented Aug 19, 2021

closes #1363

FSM1 and others added 30 commits August 12, 2021 23:49
…haredFolderModal.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
…eCreateOrEditSharedFolder.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
…/index.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
…/TransferToast.tsx

Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
Co-authored-by: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com>
@Tbaut Tbaut marked this pull request as ready for review August 20, 2021 16:17
@asnaith
Copy link
Member

asnaith commented Aug 20, 2021

Hey Thibaut, this is working really nicely.

A couple of small observations, some may not be issues but I wanted to mention them and let you decide.

a) It looks like the "download complete" modal is using the wrong colour icon (but I'm guessing this is the same one we always use and probably was pre-existing before these change).

Screen Shot 2021-08-20 at 9 46 10 AM

b) I noticed that the option doesn't appear to download a folder as a zip (even though it contains files) if that's the only item selected on the root

Screen Shot 2021-08-20 at 9 49 26 AM

c) If you attempt to start a file upload at the same time the two toasts will overlap each other and do not stack

Screen Shot 2021-08-20 at 9 41 27 AM

Screen.Recording.2021-08-20.at.9.39.57.AM.mov

d) The option to download as a zip is missing from the kebab menu (makes sense to have it for folders containing items?).

e) It's not possible to use this feature on a mobile device (because the checkboxes don't appear in the mobile view)

f) It's not possible to use this feature when the file browser is in grid mode (also because there are checkboxes in that view)

g) Once the selection has been made and the download has began would it make sense to disable the button until a new selection has been made? I'm guessing it would be pretty silly for someone to spam click the download button but it is possible. I was just not sure if this could be used maliciously to generate a lot of load and cause us issues? For example a 10gb collection of files spammed clicked hundreds of times.

Screen Shot 2021-08-20 at 9 42 35 AM

@Tbaut
Copy link
Collaborator Author

Tbaut commented Aug 20, 2021

aah lot's of good points. Thanks for stress testing this. This feature is actually reusing the download toast, some of what you mention would also happen without this feature and require a better design, namely

  • e) f) can't move/delete (and not download) multiple files in the grid mode or on mobile because there's no checkbox, this should prob be solved with a ctrl+click selection/long click on mobile. That's def for another issue.
  • c) overlap with upload and download toast, this happens with a normal download as well I imagine. I'll check it out.

Preventing the click when there's a download makes sense, although I'm not sure, because we specifically don't want to block the UI, if someone wants to be malicious, they can fire programmatically 1000 calls still.

edit: what I'll do is remove the selection then, I guess that should be fine.

What I'll do

a) It looks like the "download complete" modal is using the wrong colour

That's no me, but small enough indeed

b) I noticed that the option doesn't appear to download a folder as a zip

Didn't think about it either, I will allow it.

d) The option to download as a zip is missing from the kebab menu

Same, didn't think about it, totally makes sense.

@asnaith
Copy link
Member

asnaith commented Aug 20, 2021

What I'll do

a) It looks like the "download complete" modal is using the wrong colour

b) I noticed that the option doesn't appear to download a folder as a zip

d) The option to download as a zip is missing from the kebab menu

Great, sounds good 👍. I've created separate issues for the other things discovered in testing but not introduced by this PR #1465 and #1466

De-selecting the items after initiating the download sounds like a good solution too.

@Tbaut
Copy link
Collaborator Author

Tbaut commented Aug 23, 2021

Added the following:

  • Download complete color (for this one, but also upload and transfer)
  • menu entry for folders to download as zip
  • button available when selecting just one folder
  • remove the selection after the user clicks on download as zip

@Tbaut
Copy link
Collaborator Author

Tbaut commented Aug 23, 2021

Added the following:

  • Use relative link to where the user downloads from. E.g don't redo the whole structure in the archive, if you dl some files from /fold1, then fold1 will not appear in the archive
  • remove the first / so that windows can see the files and folders. Thanks @FSM1 :)

@asnaith
Copy link
Member

asnaith commented Aug 23, 2021

The new additional changes are looking almost perfect.

menu entry for folders to download as zip

👆 just a small issue with this - the menu option is there and works as intended if the folder contains files. However, if the folder is empty the option is still there but nothing happens then the option is clicked. Perhaps it'd be best to not show the option if the folder is empty or send feedback to the user if they are attempting to download a blank folder, what do you think?

Everything else is looking great

Copy link
Contributor

@RyRy79261 RyRy79261 left a comment

Choose a reason for hiding this comment

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

Well that was a beautiful experience 🔥

@Tbaut
Copy link
Collaborator Author

Tbaut commented Aug 24, 2021

Perhaps it'd be best to not show the option if the folder is empty or send feedback to the user if they are attempting to download a blank folder, what do you think?

Good point, having nothing happening is def wrong. The problem with what you propose is that the users will first think it's a bug, because "why isn't the menu entry present for this folder, but it is for this one"? So I'll add an error toast, I think it's more explicit (it's also makes the whole logic a bit more convoluted but that's a needed evil I guess).

@Tbaut Tbaut merged commit 51808aa into dev Aug 24, 2021
@Tbaut Tbaut deleted the feat/tbaut-download-all-1363 branch August 24, 2021 12:04
@asnaith
Copy link
Member

asnaith commented Aug 24, 2021

I'll add an error toast, I think it's more explicit (it's also makes the whole logic a bit more convoluted but that's a needed evil I guess)

👍 Nice solution, works well

@FSM1 FSM1 mentioned this pull request Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed 👀 Added to PRs when they need more review Type: Feature Added to PRs to identify that the change is a new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download all files at once
5 participants