File picker should support multiple selection
Describe the bug There appears to be no way to import more than one .zim file at a time into the library.
Expected behavior When picking files to add to the library, it should be possible to select more than one by long-pressing several file icons in succession. Ideally, it would be possible to drag to select a range of files a la Google Photos, and a Select All would be provided.
Steps to reproduce the behavior:
- Click '+' in the Library.
- Long-press a file icon to select it.
- Long-press a second file icon.
- The first file becomes deselected in favor of the second; it is not possible to have more than 1 selected.
Environment
- Version of Kiwix Android : 3.13.0
- Device : Galaxy Tab A9+
- OS version : 14
The idea is good, but at this stage not sure this is worth the complexification of the code.
It looks like this started to get implemented, because long-pressing a file selects it and it says "1 Selected".
An interim solution that might require less UI development effort might be to long-press the enclosing folder (from one level up in the tree) and be able to add it in one shot.
When considering how to prioritize this issue, it might help if I described my user journey. I'm not sure if it's common but I don't think it's too odd.
When I found out about Kiwix the other day I decided to load up a 1TB SD card to install on my tablet. I set up the various torrents and web downloads to grab most of the available ZIMs, which took about a day but operated unattended.
Once all these files were on the SD card, I expected to be able to open them up in Kiwix and use them; however, between this issue and #4182 it will be at least another day of fairly intensively babysitting my tablet, when it could easily have been accomplished in seconds.
@kelson42 This feature is easily implemented for the full version of Kiwix as there is no need to copy/move the ZIM files, and selected ZIM files will easily show on the library screen. However, for the PS version, we have to fully handle all selected ZIM files. The current situation is handling the single file. So we have to handle these scenarios:
-
Show a list of ZIM files in the UI that the user selected(In dialog).
-
When the user copy/move ZIM files, we will need to copy/move the ZIM files one by one(and should the progress of number of copied/moved ZIM files), and if any error occurs in copy/move we have to handle those scenarios.
- If the device does not have enough storage, it should show the storage selection dialog and copy/move the other ZIM files in the chosen storage.
- If there is some other error that occurs while copy/move then it should continue to copy/move other ZIM files and show the error at last of the operation that these ZIM files failed to copy/move so that the user can again try to copy/move ZIM files.
- Also, we have to handle the failed operation, if the user chooses copy and some error happens it should delete the temp copied file. Same for move operation.
-
When user selects the multiple ZIM files then opening the ZIM file in the reader will skip as the user wants to load the ZIM files in the application.
Can you please assign me this issue ?
@salehdemir Wir are not ready to implement this now as the workflow is still in discussion.
@MohitMaliFtechiz Thank you for your feedback in January. I don't think we need to show the list of ZIM files selected, but for the rest I agree with your comment. Here my comments to complete yours:
- Once the files selected with the pickers, the first thing to do is to verify if we can copy/mve (because of space, permission, etc.) the all the selected ZIM files. If there is any problem, the whole process should be stopped with appropriate error message.
- If all prerequistes fullfilled, then we can move forward with the copy/move, one by one (so basically looping around the code used for one file).
- If any problem in copying any file, then an error should be displayed and the user should be invited to continue with other files... or not.
Actually the 3 points above are valid for the standalone version as well.
@MohitMaliFtechiz Do you agree? Do you see any points to discuss before implementation?
@kelson42 I agree with the approach. But here I want to add a point, before the user can only select one file and they are aware which file is copying/moving currently. But now, we are selecting multiple files and copy/move them, so we should show the user which file is currently copying/moving for a better user experience(We can show the currently copying/moving ZIM file name). @kelson42 What do you think?
Yes. Today we have dialog which says "Cooying ZIM file..." And in that case it should be "Cooying ZIM file xyz.zim...". Very small improvement there.