android icon indicating copy to clipboard operation
android copied to clipboard

Unified Notifications

Open alperozturk96 opened this issue 1 year ago • 4 comments

Problem

  1. For each upload, download or any other file related operation app throwing notification
  2. Same notification may appear again time to time
  3. Code complexity increased in-time and causes problem for maintenance
  4. Too many notification annoys user

As mentioned in these issues:

Solution

  1. If multiple file operation running at the same time or back to back no need to throw multiple notification. Single notification can show progress for all operations one by one.
  2. Managing notifications directly inside service or inside some other class causes problem regarding code readability and maintenance. One single class that will handle notifications and it will be reusable for different needs. And with proper tests (unit, integration) we can be sure about robustness of our solution.

alperozturk96 avatar Dec 08 '23 10:12 alperozturk96

Ok , if i am not wrong , it's like if we upload 5 files , it shows 5 upload bars one by one in notification , that be could be one , am I correct ?

satvik2131 avatar Dec 09 '23 16:12 satvik2131

Ok , if i am not wrong , it's like if we upload 5 files , it shows 5 upload bars one by one in notification , that be could be one , am I correct ?

No need to show 5 different notification for 5 different files, we can use one notification for multiple files.

alperozturk96 avatar Dec 18 '23 08:12 alperozturk96

FYI: I've created a temporary label for tracking transfer related notifications which might be a further resource to study the problem(s): https://github.com/nextcloud/android/labels/hotspot%3A%20uploads%20tab%20and%20transfer%20notifications

joshtrichards avatar Dec 27 '23 21:12 joshtrichards

To illustrate this problem I made a recording during an upload of my pictures folder:

https://github.com/nextcloud/android/assets/39345772/eca61360-2ac4-42f5-8bf7-54431f611231 This was when it was a bit slower as well, slightly smaller files or if I would have recorded while my phone was closer to the wifi router it would look almost epileptic. Clicking/interacting with the notification below is impossible (or with the nc notification for that matter).

It does make sense to do the upload silently, but it should be an user choice: there's value in seeing how the upload is progressing. An example of that is if one uploads a folder manually, and such is not an automatic upload.

The optimal solution is to have a single notification during upload that:

  • shows overall progress with a bar that simply is x uploaded out of y items (nbr %)
  • Another progress bar visible only when the notification is expanded, showing the currently uploading items progress % out of total size (GiB/MiB or w/e)
  • That notification can be disabled for automatic uploads in app, or disabled altogether trough android notification settings, the latter already possible as is.

EDIT: Here is how it can look when the uploads are really fast: https://github.com/nextcloud/android/assets/39345772/b6cb4393-e1dc-4db4-a15e-8a6793c85fca

MrRinkana avatar Mar 31 '24 12:03 MrRinkana

@alperozturk96 thank you for this improvement!

Would it be possible, that the progress bar shows the progress over the whole batch of files that get uploaded (and not for each file)? Then it would be easier to implement the parallel upload/download for Android: https://github.com/nextcloud/android/issues/10124

BluePixel4k avatar Jun 03 '24 10:06 BluePixel4k

@alperozturk96 thank you for this improvement!

Would it be possible, that the progress bar shows the progress over the whole batch of files that get uploaded (and not for each file)? Then it would be easier to implement the parallel upload/download for Android: #10124

Hello

Thanks for the comment. We are using work manager and for each work manager we have unified notification right now.

For Example

In home screen when user wants to download File A and File B user will see two notifications because two different workers started

But if user wants to download whole folder, user going to see one notification for all files inside that specific folder.

Regarding progress bar, it is an indication only for one file's upload or download progress.

I will discuss unified progress bar and unified worker for all downloads and uploads regardless of worker with our team and get back to you as soon as possible. Current master branch is much better than before, and of course we can make it better in the future.

Getting feedback from community is always making us happy.

You can check the PR for improvements we have done.

alperozturk96 avatar Jun 03 '24 12:06 alperozturk96

Hello @alperozturk96,

thanks for your response!

I already tested the latest APK from this PR, and yes it's a good improvement, thx 👍

Could you also discuss the parallel upload/download feature (#10124)? This would speed up the upload/download process a lot :)

Thank you!

BluePixel4k avatar Jun 03 '24 13:06 BluePixel4k